hi guys,Steve<br>A few day ago I post an item " mapserver 5.6 CGI output GeoJSON format " <a href="http://lists.osgeo.org/pipermail/mapserver-users/2012-April/072028.html">here</a> in which I asked a question about mapserver CGI output GeoJSON,finally with Steve's help I got it!<pre>
<a href="http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&layer=tielu&mode=nquery&qformat=geojson"></a>URL1:<a href="http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&layer=tielu&mode=nquery&qformat=geojson">http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&layer=tielu&mode=nquery&qformat=geojson</a>. <br>
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,<br>then I execute <br>URL2:<a href="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">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</a><br>
but the output is as same as the URL1's output, in fact the qstring, qitem don't take affect.<br>I searched and visited <br><a href="http://www.osgeo.org/pipermail/mapserver-users/2003-April/042003.html">http://www.osgeo.org/pipermail/mapserver-users/2003-April/042003.html</a><br>
and <br><a href="http://lists.osgeo.org/pipermail/mapserver-users/2009-August/062581.html">http://lists.osgeo.org/pipermail/mapserver-users/2009-August/062581.html</a>, which are all Steve's ansewer posts. <br>so I modified tielu layer in the mapfile as Steve's suggestion,<br>
...<br> METADATA<br> 'ows_title' 'tielu'<br> "wfs_title" "tielu" <br> ....<br> "qstring_validation_pattern" '^[A-Z]{2,8}$' <br> END<br>
...<br> then I execute <br><a href="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">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</a>,<br>
and returns the error,<br>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.<br><br><br></pre><br>