Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter
Hi Jeff, The filter encoding does not work on the new instance which runs Mapserver 7.0 but the same request runs correctly when I use Mapserver 6.0.4 with duplicated mapfile and filter. My test filter request is as below: http://gisappsproawvc2:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/SanbornImage/SanbornImage_wfs.map&&REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0&TYPENAME=SanbornGeoref&MAXFEATURES=200&; &Filter=shape-73.2239,33.4879 -71.8578,34.8471 I am not sure why it is not working when I switch to newer version. That being said, there could be some part I missed when I install/configure Mapserver. I am using MS4W 3.1.4, data source is in SQL Server spatial. Please advise how could I troubleshoot this. Thanks, -Original Message- From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna Sent: Wednesday, August 17, 2016 4:45 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter Could you try to duplicate your filter request, manually? Here is an example from the MapServer WFS Filter Encoding howto: http://demo.mapserver.org/cgi-bin/wfs?&VERSION=1.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=cities&Filter=Name>NAME135.2239,34.4879 135.8578,34.8471 Does a manually-created filter request work for you? (it just takes a little time to write the full request through the url, but it is very useful for testing) More working filters can be found in the howto: http://mapserver.org/ogc/filter_encoding.html -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ On 2016-08-17 2:31 PM, TMa Teng wrote: > Yes, I am able to use GET method to get the features when use the WFS. > > Get request example: > http://gisappsdev:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/SanbornImage/SanbornImage_wfs.map&REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0&TYPENAME=SanbornGeoref&MAXFEATURES=20&bbox=-72.93411254882812,41.30730211327143,-72.93099045753479,41.30866411858396 > > It returns features as expected. > > The problem is when I try to get features using POST method on the same WFS > (see raw in fiddler below): ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] performance question - joining dbf tables in MapServer
Hello, I am considering joining my tax data to my parcel dataset on the fly using the MapServer Join function. This way I can update my tax data weekly, and my parcels as needed. My tax data will be in a dbf and my parcels will be in a shapefile. Questions: * Is there any performance hit using joining on the fly vs keeping the tax data in the shapefile? * Are there any tips I should be aware about to make the joins work faster? http://mapserver.org/mapfile/join.html. Thank You! Sincerely, Mark Volz ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter
Le mercredi 17 août 2016 19:31:40, TMa Teng a écrit : > Yes, I am able to use GET method to get the features when use the WFS. > > Get request example: > http://gisappsdev:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/SanbornImage/Sanb > ornImage_wfs.map&REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0&TYPENAME=Sanb > ornGeoref&MAXFEATURES=20&bbox=-72.93411254882812,41.30730211327143,-72.9309 > 9045753479,41.30866411858396 > > It returns features as expected. > > The problem is when I try to get features using POST method on the same WFS > (see raw in fiddler below): > > POST > http://gisappsdev:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/SanbornImage/San > bornImage_wfs.map HTTP/1.1 Content-Type: multipart/form-data; > User-Agent: Fiddler > Content-Length: 814 > Host: gisappsdev:8080 I've tried the following with a mapfile from MapServer test suite : cat request.xml | CONTENT_TYPE=text/xml MS_MAPFILE=wfs_200.map REQUEST_METHOD=POST mapserv where request.xml is as close as possible to yours : http://www.opengis.net/wfs"; service="WFS" version="1.1.0" maxFeatures="100" xsi:schemaLocation="http://www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.1.0/wfs.xsd"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://gisappsdev:8080/cgi-bin/mapserv.exe"; srsName="EPSG:4326"> http://www.opengis.net/ogc";> shape http://www.opengis.net/gml";> -81 41 -80.9 41.01 And it returns: Content-Type: text/xml; subtype=gml/3.1.1; charset=UTF-8 http://mapserver.gis.umn.edu/mapserver"; xmlns:gml="http://www.opengis.net/gml"; xmlns:wfs="http://www.opengis.net/wfs"; xmlns:ogc="http://www.opengis.net/ogc"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?myparam=something&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=province&OUTPUTFORMAT=text/xml; %20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd";> missing So it behaves as expected. Looking at the above header, this might perhaps come from "Content-Type: multipart/form-data;" The terminating semi-column is a bit suspicous. Also this is incorrect in that instance and should be "text/xml". Another possibilitiy, more likely, is that the Content-Length is wrong. If I paste your below XML with DOS end-of-line (CR-LF), I get 813 bytes (or 815 if I add an extra return line), not 814. So MapServer could try to read one extra byte that never comes, hence the timeout. > > > http://www.opengis.net/wfs"; service="WFS" > version="1.1.0" maxFeatures="100" > xsi:schemaLocation="http://www.opengis.net/wfs > http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> typeName="SanbornGeoref" > xmlns:feature="http://gisappsdev:8080/cgi-bin/mapserv.exe"; > srsName="EPSG:4326"> http://www.opengis.net/ogc";> > > shape > http://www.opengis.net/gml";> > -81 41 > -80.9 41.01 > > > > > -- Spatialys - Geospatial professional services http://www.spatialys.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] [SOLVED] Re: Filtering NULL values from Postgis Layer in Mapserver 7
Steve, thank you Lime, Steve D (MNIT) wrote > The filter option is still there - it's just implemented as a processing > option instead. So what was: > > FILTER 'myitem != NULL' > > Becomes: > > PROCESSING 'NATIVE_FILTER=myitem != NULL' > > Steve I can confirm that making the FILTER a PROCESSING option indeed works, even with runtime substitution. (using = NULL does not work, IS NULL must be used) So the mapserver6 style line: FILTER (NOT (%MY_VAR1% IS NULL OR %MY_VAR2% IS NULL)) in mapserver 7 becomes: PROCESSING 'NATIVE_FILTER=(NOT (%MY_VAR1% IS NULL OR %MY_VAR2% IS NULL))' So I summarize: - CLASS EXPRESSIONS will treat NULL values in numerical fields as zero (and I presume it does the same for empty numeric fields in shapefiles). It is not possible to prevent this behaviour. - To prevent NULL values from being rendered a FILTER must be applied, or a subselect in the DATA statement must be used. - In mapserver 6 that can be a native filter with a syntax like FILTER (NOT (%MY_VAR1% IS NULL OR %MY_VAR2% IS NULL)) - In mapserver 7 that filter must be added as a processing option with a syntax like PROCESSING 'NATIVE_FILTER=(NOT (%MY_VAR1% IS NULL OR %MY_VAR2% IS NULL))' It still would be very nice to have an option to ignore empty fields/ NULL values/ missing values like - with a single config option. Shall I file a feature request for that? MArco -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Filtering-NULL-values-from-Postgis-Layer-in-Mapserver-7-tp5280893p5281145.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users