Your pattern allows for upper case letters and you're passing lower case. Hence 
the  error.

Steve

From: Li Quansheng [mailto:quansheng...@gmail.com]
Sent: Saturday, April 21, 2012 10:38 AM
To: mapserver-users@lists.osgeo.org; Lime, Steve D (DNR)
Subject: mapserver 5.6 CGI output GeoJSON format 2

hi guys,Steve
A few day ago I post an item " mapserver 5.6 CGI output GeoJSON format " 
here<http://lists.osgeo.org/pipermail/mapserver-users/2012-April/072028.html> 
in which I asked a question about  mapserver CGI output GeoJSON,finally with 
Steve's help I got it!



URL1:http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&layer=tielu&mode=nquery&qformat=geojson.


But  now I want to add where-clause to prefilter,or I want set filter with CGI. 
The 'tielu' layer stored in postgis including these fields: 
gid,type,name,comment,the_geom,
then I execute
URL2:http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&layer=tielu&mode=nquery&qlayer=tielu&qitem=name&qstring=namexx&qformat=geojson


but the output is as same as the URL1's output, in fact the qstring, qitem 
don't take affect.
I searched  and visited
http://www.osgeo.org/pipermail/mapserver-users/2003-April/042003.html


and
http://lists.osgeo.org/pipermail/mapserver-users/2009-August/062581.html,  
which are all Steve's  ansewer posts.
so I modified tielu layer in the mapfile as Steve's suggestion,


...
    METADATA
          'ows_title'    'tielu'
          "wfs_title"    "tielu"
          ....
         "qstring_validation_pattern" '^[A-Z]{2,8}$'
    END


...
 then I execute
http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&layer=tielu&mode=itemnquery&qlayer=tielu&qitem=name&qstring=namexx&qformat=geojson,


and returns the error,
mapserv(): Web application error. Parameter 'qstring' value fails to validate.

msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.

msEvalRegex(): Regular expression error. String failed expression test.

I have to search and search, but couldn't work out. any suggestion, thans very 
much.


_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to