[mapserver-users] mapserver 5.6 CGI output GeoJSON format 2

Li Quansheng quansheng.cs at gmail.com
Sat Apr 21 11:38:01 EDT 2012


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!

 <http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&layer=tielu&mode=nquery&qformat=geojson>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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120421/e1431deb/attachment-0001.html


More information about the mapserver-users mailing list