[mapserver-users] RE: mapserver 5.6 CGI output GeoJSON format 2
Lime, Steve D (DNR)
Steve.Lime at state.mn.us
Thu Apr 26 09:33:07 PDT 2012
Your pattern allows for upper case letters and you're passing lower case. Hence the error.
Steve
From: Li Quansheng [mailto:quansheng.cs at gmail.com]
Sent: Saturday, April 21, 2012 10:38 AM
To: mapserver-users at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120426/62a1aef9/attachment.htm>
More information about the MapServer-users
mailing list