WFS Filter in GET parameter doesn't work with PostGIS Layer

classic Classic list List threaded Threaded
6 messages Options
dr
Reply | Threaded
Open this post in threaded view
|

WFS Filter in GET parameter doesn't work with PostGIS Layer

dr
Hello!

$ mapserv -v
MapServer version 6.2.0

Trying to use filter with the following URL:

http://localhost/cgi-bin/mapserv?map=/home/wfs.map&service=wfs&version=1.1.0&request=GetFeature&typeName=water&Filter=<Filter><PropertyIsEqualTo><PropertyName>natural</PropertyName><Literal>wetland</Literal></PropertyIsEqualTo></Filter>

But server response looks like:

<wfs:FeatureCollection xmlns:ms="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/cgi-bin/mapserv?map=/home/rykov/nextgis/vega2013/wfs.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=water&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
<gml:Null>missing</gml:Null>
</gml:boundedBy>
</wfs:FeatureCollection>


Try to debug mapfile by adding DEBUG 5 то MAP section. Accordingly log file - no errors, moreover if I change original mapfile with temporary mapfile created by MapServer with hardcoded FILTER expression - all works fine.
_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev
Reply | Threaded
Open this post in threaded view
|

Re: WFS Filter in GET parameter doesn't work with PostGIS Layer

Martin Kofahl-3
Hi Denis,
which datastore do you use? In case of sql, does the database return any features?

Martin

2013/1/21 Denis Rykov <[hidden email]>
Hello!

$ mapserv -v
MapServer version 6.2.0

Trying to use filter with the following URL:

http://localhost/cgi-bin/mapserv?map=/home/wfs.map&service=wfs&version=1.1.0&request=GetFeature&typeName=water&Filter=<Filter><PropertyIsEqualTo><PropertyName>natural</PropertyName><Literal>wetland</Literal></PropertyIsEqualTo></Filter>

But server response looks like:

<wfs:FeatureCollection xmlns:ms="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/cgi-bin/mapserv?map=/home/rykov/nextgis/vega2013/wfs.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=water&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
<gml:Null>missing</gml:Null>
</gml:boundedBy>
</wfs:FeatureCollection>


Try to debug mapfile by adding DEBUG 5 то MAP section. Accordingly log file - no errors, moreover if I change original mapfile with temporary mapfile created by MapServer with hardcoded FILTER expression - all works fine.
_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev



_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev
dr
Reply | Threaded
Open this post in threaded view
|

Re: WFS Filter in GET parameter doesn't work with PostGIS Layer

dr
Hi!

PostGIS datastore and If  I use temporary mapfile created by MapServer - PostGIS returns features which fits filter value.

On Mon, Jan 28, 2013 at 3:09 PM, Martin Kofahl <[hidden email]> wrote:
Hi Denis,
which datastore do you use? In case of sql, does the database return any features?

Martin

2013/1/21 Denis Rykov <[hidden email]>
Hello!

$ mapserv -v
MapServer version 6.2.0

Trying to use filter with the following URL:

http://localhost/cgi-bin/mapserv?map=/home/wfs.map&service=wfs&version=1.1.0&request=GetFeature&typeName=water&Filter=<Filter><PropertyIsEqualTo><PropertyName>natural</PropertyName><Literal>wetland</Literal></PropertyIsEqualTo></Filter>

But server response looks like:

<wfs:FeatureCollection xmlns:ms="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/cgi-bin/mapserv?map=/home/rykov/nextgis/vega2013/wfs.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=water&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
<gml:Null>missing</gml:Null>
</gml:boundedBy>
</wfs:FeatureCollection>


Try to debug mapfile by adding DEBUG 5 то MAP section. Accordingly log file - no errors, moreover if I change original mapfile with temporary mapfile created by MapServer with hardcoded FILTER expression - all works fine.
_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev




_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev
Reply | Threaded
Open this post in threaded view
|

Re: WFS Filter in GET parameter doesn't work with PostGIS Layer

Martin Kofahl-3
Hi Denis,
the filter PropertyIsEqualTo is working for me. Are you abel to compile from trunk (but PropertyIsEqualTo should have worked in 6.0, too) and can you post the full mapfile?

Martin

2013/1/28 Denis Rykov <[hidden email]>
Hi!

PostGIS datastore and If  I use temporary mapfile created by MapServer - PostGIS returns features which fits filter value.


On Mon, Jan 28, 2013 at 3:09 PM, Martin Kofahl <[hidden email]> wrote:
Hi Denis,
which datastore do you use? In case of sql, does the database return any features?

Martin

2013/1/21 Denis Rykov <[hidden email]>
Hello!

$ mapserv -v
MapServer version 6.2.0

Trying to use filter with the following URL:

http://localhost/cgi-bin/mapserv?map=/home/wfs.map&service=wfs&version=1.1.0&request=GetFeature&typeName=water&Filter=<Filter><PropertyIsEqualTo><PropertyName>natural</PropertyName><Literal>wetland</Literal></PropertyIsEqualTo></Filter>

But server response looks like:

<wfs:FeatureCollection xmlns:ms="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/cgi-bin/mapserv?map=/home/rykov/nextgis/vega2013/wfs.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=water&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
<gml:Null>missing</gml:Null>
</gml:boundedBy>
</wfs:FeatureCollection>


Try to debug mapfile by adding DEBUG 5 то MAP section. Accordingly log file - no errors, moreover if I change original mapfile with temporary mapfile created by MapServer with hardcoded FILTER expression - all works fine.
_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev





_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev
Reply | Threaded
Open this post in threaded view
|

Re: WFS Filter in GET parameter doesn't work with PostGIS Layer

jbicik
In reply to this post by dr
Hi Denis,

I came across similar response when I did not specify PostgreSQL layer's extent explicitly in the map file. Might be worth to give it a go to see if that helps.

Regards, Josef
Reply | Threaded
Open this post in threaded view
|

Re: WFS Filter in GET parameter doesn't work with PostGIS Layer

tbonfort
In reply to this post by dr
Hi Denis,
Checking at our autotests, it would seem that GET Filters are
supported and working in 6.2 with postgis:

- https://github.com/mapserver/msautotest/blob/444c55add8e6c0e56436250f8fe947f3ee5bd3c7/wxs/wfs_filter_postgis.map#L9

- https://github.com/mapserver/msautotest/blob/444c55add8e6c0e56436250f8fe947f3ee5bd3c7/wxs/expected/wfs_filter_postgis_property_is_equal.xml

Setting a layer extent does not seem to be a requirement either.
Working from the supplied example, please open an issue and provide a
testcase reproducing the issue if this is effectively a mapserver bug.

regards,
thomas

On 21 January 2013 20:36, Denis Rykov <[hidden email]> wrote:

> Hello!
>
> $ mapserv -v
> MapServer version 6.2.0
>
> Trying to use filter with the following URL:
>
>>
>> http://localhost/cgi-bin/mapserv?map=/home/wfs.map&service=wfs&version=1.1.0&request=GetFeature&typeName=water&Filter=<Filter><PropertyIsEqualTo><PropertyName>natural</PropertyName><Literal>wetland</Literal></PropertyIsEqualTo></Filter>
>
>
> But server response looks like:
>
>> <wfs:FeatureCollection xmlns:ms="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/cgi-bin/mapserv?map=/home/rykov/nextgis/vega2013/wfs.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=water&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1
>> http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
>> <gml:boundedBy>
>> <gml:Null>missing</gml:Null>
>> </gml:boundedBy>
>> </wfs:FeatureCollection>
>
>
>
> Try to debug mapfile by adding DEBUG 5 то MAP section. Accordingly log file
> - no errors, moreover if I change original mapfile with temporary mapfile
> created by MapServer with hardcoded FILTER expression - all works fine.
> _______________________________________________
> mapserver-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
_______________________________________________
mapserver-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-dev