Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

2016-08-17 Thread Jeff McKenna
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?=1.0.0=WFS=GetFeature=cities=Name>NAMEsrsName='EPSG:4326'>135.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=GetFeature=WFS=1.0.0=SanbornGeoref=20=-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

Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

2016-08-17 Thread TMa Teng
Thank you Even. The error message is " The gateway did not receive a timely 
response from the upstream server or application".

I didn’t specify the srsname in the query since output is defined in EPSG:4326 
same as the mapfile. I have an identical server that has not been upgrade to 
mapserver 7.0 yet. And it returns the fesature collection successfully using 
exact the same mapfile and same request body.

Martin
 
-Original Message-
From: Even Rouault [mailto:even.roua...@spatialys.com] 
Sent: Wednesday, August 17, 2016 11:37 AM
To: mapserver-users@lists.osgeo.org
Cc: TMa Teng 
Subject: Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

Le mercredi 17 août 2016 16:57:44, TMa Teng a écrit :
> Hi guys,
> 
> I am currently facing problems using WFS in MapServer 7.0. The WFS 
> works in MapServer 6.0.4 before I upgrade MapServer 7.0 and Mapfile, 
> database connection everything has not been changed. Is there any 
> change to WFS call from MapServer version 6.0 to version 7.x? Please 
> advise me if there is anything I am missing.

You didn't explain what didn't work exactly. Like do you get a response with 
zero features in it ?

This might be an issue with the coordinate order of  in lowerCorner and 
upperCorner query. I assume that the SRS of the layer is EPSG:4326 ? If so, you 
should likely put the values in latitude longitude order (they look like being 
longitude latitude in your below sample). And it would also be better to 
explictly specify the SRS by adding a srsName="urn:ogc:def:crs:EPSG::4326" 
attribute to the  element.

> 
> 
> My request body:
> http://www.opengis.net/wfs; service="WFS"
> version="1.1.0" maxFeatures="200"
> 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="parcelpoints"
> xmlns:feature="http://mapserver.gis.umn.edu/mapserver;>  xmlns:ogc="http://www.opengis.net/ogc;>
>   
> shape
> http://www.opengis.net/gml;>
>   -81 41
>   -80.9 41.01
> 
>   
> 
>   
> 
> 
> Thanks in advance,
> 
> Martin

--
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

Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

2016-08-17 Thread TMa Teng
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=GetFeature=WFS=1.0.0=SanbornGeoref=20=-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):

POST 
http://gisappsdev:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/SanbornImage/SanbornImage_wfs.map
 HTTP/1.1
Content-Type: multipart/form-data; 
User-Agent: Fiddler
Content-Length: 814
Host: gisappsdev:8080


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;>
  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

  

  


It took very long to return a 504 error gameway timeout.

Thanks,


-Original Message-
From: Even Rouault [mailto:even.roua...@spatialys.com] 
Sent: Wednesday, August 17, 2016 12:01 PM
To: TMa Teng 
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

Le mercredi 17 août 2016 17:44:54, TMa Teng a écrit :
> Thank you Even. The error message is " The gateway did not receive a 
> timely response from the upstream server or application".

Do other GetFeature queries work ? GetCapabilities ? 

> 
> I didn’t specify the srsname in the query since output is defined in
> EPSG:4326 same as the mapfile. I have an identical server that has not 
> been upgrade to mapserver 7.0 yet. And it returns the fesature 
> collection successfully using exact the same mapfile and same request body.
> 
> Martin
> 
> -Original Message-
> From: Even Rouault [mailto:even.roua...@spatialys.com]
> Sent: Wednesday, August 17, 2016 11:37 AM
> To: mapserver-users@lists.osgeo.org
> Cc: TMa Teng 
> Subject: Re: [mapserver-users] MapServer 7.0 WFS post request using 
> ogc filter
> 
> Le mercredi 17 août 2016 16:57:44, TMa Teng a écrit :
> > Hi guys,
> > 
> > I am currently facing problems using WFS in MapServer 7.0. The WFS 
> > works in MapServer 6.0.4 before I upgrade MapServer 7.0 and Mapfile, 
> > database connection everything has not been changed. Is there any 
> > change to WFS call from MapServer version 6.0 to version 7.x? Please 
> > advise me if there is anything I am missing.
> 
> You didn't explain what didn't work exactly. Like do you get a 
> response with zero features in it ?
> 
> This might be an issue with the coordinate order of  in lowerCorner 
> and upperCorner query. I assume that the SRS of the layer is EPSG:4326 
> ? If so, you should likely put the values in latitude longitude order 
> (they look like being longitude latitude in your below sample). And it 
> would also be better to explictly specify the SRS by adding a 
> srsName="urn:ogc:def:crs:EPSG::4326" attribute to the  
> element.
> 
> > My request body:
> > http://www.opengis.net/wfs; service="WFS"
> > version="1.1.0" maxFeatures="200"
> > 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="parcelpoints"
> > xmlns:feature="http://mapserver.gis.umn.edu/mapserver;>  > xmlns:ogc="http://www.opengis.net/ogc;>
> > 
> >   
> >   
> > shape
> > http://www.opengis.net/gml;>
> > 
> >   -81 41
> >   -80.9 41.01
> > 
> > 
> >   
> >   
> > 
> > 
> >   
> >   
> > 
> > 
> > 
> > Thanks in advance,
> > 
> > Martin
> 
> --
> Spatialys - Geospatial professional services http://www.spatialys.com

--
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

Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

2016-08-17 Thread Even Rouault
Le mercredi 17 août 2016 17:44:54, TMa Teng a écrit :
> Thank you Even. The error message is " The gateway did not receive a timely
> response from the upstream server or application".

Do other GetFeature queries work ? GetCapabilities ? 

> 
> I didn’t specify the srsname in the query since output is defined in
> EPSG:4326 same as the mapfile. I have an identical server that has not
> been upgrade to mapserver 7.0 yet. And it returns the fesature collection
> successfully using exact the same mapfile and same request body.
> 
> Martin
> 
> -Original Message-
> From: Even Rouault [mailto:even.roua...@spatialys.com]
> Sent: Wednesday, August 17, 2016 11:37 AM
> To: mapserver-users@lists.osgeo.org
> Cc: TMa Teng 
> Subject: Re: [mapserver-users] MapServer 7.0 WFS post request using ogc
> filter
> 
> Le mercredi 17 août 2016 16:57:44, TMa Teng a écrit :
> > Hi guys,
> > 
> > I am currently facing problems using WFS in MapServer 7.0. The WFS
> > works in MapServer 6.0.4 before I upgrade MapServer 7.0 and Mapfile,
> > database connection everything has not been changed. Is there any
> > change to WFS call from MapServer version 6.0 to version 7.x? Please
> > advise me if there is anything I am missing.
> 
> You didn't explain what didn't work exactly. Like do you get a response
> with zero features in it ?
> 
> This might be an issue with the coordinate order of  in lowerCorner and
> upperCorner query. I assume that the SRS of the layer is EPSG:4326 ? If
> so, you should likely put the values in latitude longitude order (they
> look like being longitude latitude in your below sample). And it would
> also be better to explictly specify the SRS by adding a
> srsName="urn:ogc:def:crs:EPSG::4326" attribute to the 
> element.
> 
> > My request body:
> > http://www.opengis.net/wfs; service="WFS"
> > version="1.1.0" maxFeatures="200"
> > 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="parcelpoints"
> > xmlns:feature="http://mapserver.gis.umn.edu/mapserver;>  > xmlns:ogc="http://www.opengis.net/ogc;>
> > 
> >   
> >   
> > shape
> > http://www.opengis.net/gml;>
> > 
> >   -81 41
> >   -80.9 41.01
> > 
> > 
> >   
> >   
> > 
> > 
> >   
> >   
> > 
> > 
> > 
> > Thanks in advance,
> > 
> > Martin
> 
> --
> Spatialys - Geospatial professional services http://www.spatialys.com

-- 
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

Re: [mapserver-users] MapServer 7.0 WFS post request using ogc filter

2016-08-17 Thread Even Rouault
Le mercredi 17 août 2016 16:57:44, TMa Teng a écrit :
> Hi guys,
> 
> I am currently facing problems using WFS in MapServer 7.0. The WFS works in
> MapServer 6.0.4 before I upgrade MapServer 7.0 and Mapfile, database
> connection everything has not been changed. Is there any change to WFS
> call from MapServer version 6.0 to version 7.x? Please advise me if there
> is anything I am missing.

You didn't explain what didn't work exactly. Like do you get a response with 
zero features in it ?

This might be an issue with the coordinate order of  in lowerCorner and 
upperCorner query. I assume that the SRS of the layer is EPSG:4326 ? If so, 
you should likely put the values in latitude longitude order (they look like 
being longitude latitude in your below sample). And it would also be better to 
explictly specify the SRS by adding a srsName="urn:ogc:def:crs:EPSG::4326" 
attribute to the  element.

> 
> 
> My request body:
> http://www.opengis.net/wfs; service="WFS"
> version="1.1.0" maxFeatures="200"
> 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="parcelpoints"
> xmlns:feature="http://mapserver.gis.umn.edu/mapserver;>  xmlns:ogc="http://www.opengis.net/ogc;>
>   
> shape
> http://www.opengis.net/gml;>
>   -81 41
>   -80.9 41.01
> 
>   
> 
>   
> 
> 
> Thanks in advance,
> 
> Martin

-- 
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] MapServer 7.0 WFS post request using ogc filter

2016-08-17 Thread TMa Teng
Hi guys,

I am currently facing problems using WFS in MapServer 7.0. The WFS works in 
MapServer 6.0.4 before I upgrade MapServer 7.0 and Mapfile, database connection 
everything has not been changed. Is there any change to WFS call from MapServer 
version 6.0 to version 7.x? Please advise me if there is anything I am missing.


My request body:
http://www.opengis.net/wfs; service="WFS" 
version="1.1.0" maxFeatures="200" 
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;>
  http://mapserver.gis.umn.edu/mapserver;>
http://www.opengis.net/ogc;>
  
shape
http://www.opengis.net/gml;>
  -81 41
  -80.9 41.01

  

  


Thanks in advance,

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

Re: [mapserver-users] Filtering NULL values from Postgis Layer in Mapserver 7

2016-08-17 Thread Lime, Steve D (MNIT)
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'
  
This bypasses any translation idiosyncrasies as pointed out in this thread.

Steve  

-Original Message-
From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of deduikertjes
Sent: Wednesday, August 17, 2016 4:09 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Filtering NULL values from Postgis Layer in 
Mapserver 7

Andreas, 

Thank you. 

hmm, that's very interesting. Lets see if I understand correctly:

I observe that in the CLASS EXPRESSIONs in a Postgis layer NULL is treated
as zero for numeric fields. So NULL gets visualized in the class where zero
is visualized. In my opinion that is not very desirable. I actually would
expect a default behaviour where NULL values will not match any CLASS
EXPRESSION.

In Mapserver 6 we luckily had the FILTER option to filter out the NULL
values to remedy this behaviour. Not very elegant but very doable.

Now in Mapserver 7 we lost the FILTER option and have to write a subselect
in the DATA statement to get rid of NULL values. That seems to be a rather
complicated solution for something which seems to be a very common task.

Or am I missing something and is there a way to avoid that NULL values end
up as being treated as 0?

MArco



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Filtering-NULL-values-from-Postgis-Layer-in-Mapserver-7-tp5280893p5281035.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
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Filtering NULL values from Postgis Layer in Mapserver 7

2016-08-17 Thread Eichner, Andreas - SID
Hello Marco,

IMHO the best solution would be to implement a "IS NULL" operator or function 
for the mapserver expressions. I guess this was not implemented because MS was 
originally developed for rendering ESRI-Shapefiles which do not support NULL 
values.

According to http://mapserver.org/cgi/runsub.html#table-of-contents 
LAYER/PROCESSING should support runtime substitution since 7.0 so you could try 
to use the 'NATIVE_FILTER' processing option with something like '%MY_VAR1% is 
not null and %MY_VAR2% is not null' (very much like your FILTER in MS 6.4):

PROCESSING "NATIVE_FILTER=%MY_VAR1% is not null and %MY_VAR2% is not null"

If that does not work (check the debug log if the statement build has 
substitutions applied) your only solution would be to use the DATA statement 
with a sub-select. Something like:

DATA "the_geom from (select gid, the_geom, %MY_VAR1% as attr1, %MY_VAR2% as 
attr2 from
  geotable where %MY_VAR1% is not null and %MY_VAR2% is not null) as 
subquery
  using unique gid using srid=4326"

Hopefully one of that works for you...

> -Ursprüngliche Nachricht-
> Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im
> Auftrag von deduikertjes
> Gesendet: Mittwoch, 17. August 2016 11:09
> An: mapserver-users@lists.osgeo.org
> Betreff: Re: [mapserver-users] Filtering NULL values from Postgis Layer in
> Mapserver 7
> 
> Andreas,
> 
> Thank you.
> 
> hmm, that's very interesting. Lets see if I understand correctly:
> 
> I observe that in the CLASS EXPRESSIONs in a Postgis layer NULL is treated
> as zero for numeric fields. So NULL gets visualized in the class where
> zero
> is visualized. In my opinion that is not very desirable. I actually would
> expect a default behaviour where NULL values will not match any CLASS
> EXPRESSION.
> 
> In Mapserver 6 we luckily had the FILTER option to filter out the NULL
> values to remedy this behaviour. Not very elegant but very doable.
> 
> Now in Mapserver 7 we lost the FILTER option and have to write a subselect
> in the DATA statement to get rid of NULL values. That seems to be a rather
> complicated solution for something which seems to be a very common task.
> 
> Or am I missing something and is there a way to avoid that NULL values end
> up as being treated as 0?
> 
> MArco
> 
> 
> 
> --
> View this message in context: http://osgeo-
> org.1560.x6.nabble.com/Filtering-NULL-values-from-Postgis-Layer-in-
> Mapserver-7-tp5280893p5281035.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
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Filtering NULL values from Postgis Layer in Mapserver 7

2016-08-17 Thread deduikertjes
Andreas, 

Thank you. 

hmm, that's very interesting. Lets see if I understand correctly:

I observe that in the CLASS EXPRESSIONs in a Postgis layer NULL is treated
as zero for numeric fields. So NULL gets visualized in the class where zero
is visualized. In my opinion that is not very desirable. I actually would
expect a default behaviour where NULL values will not match any CLASS
EXPRESSION.

In Mapserver 6 we luckily had the FILTER option to filter out the NULL
values to remedy this behaviour. Not very elegant but very doable.

Now in Mapserver 7 we lost the FILTER option and have to write a subselect
in the DATA statement to get rid of NULL values. That seems to be a rather
complicated solution for something which seems to be a very common task.

Or am I missing something and is there a way to avoid that NULL values end
up as being treated as 0?

MArco



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Filtering-NULL-values-from-Postgis-Layer-in-Mapserver-7-tp5280893p5281035.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