Skip to content

Commit

Permalink
Add new test cases for WFS filters and resultType=hits to better test…
Browse files Browse the repository at this point in the history
… RFC 114
  • Loading branch information
rouault committed Feb 10, 2016
1 parent 80e078b commit 05e8264
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 2 deletions.
12 changes: 12 additions & 0 deletions wxs/expected/wfs_filter_postgis_bbox_hits.xml
@@ -0,0 +1,12 @@
Content-Type: text/xml; subtype=gml/3.1.1; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<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/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=popplace&amp;OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://ogc.dmsolutions.ca/wfs/1.1.0/wfs.xsd" timeStamp="" numberOfFeatures="1">
</wfs:FeatureCollection>

12 changes: 12 additions & 0 deletions wxs/expected/wfs_filter_postgis_filter_item_hits.xml
@@ -0,0 +1,12 @@
Content-Type: text/xml; subtype=gml/3.1.1; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<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/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=province_with_filter_item&amp;OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://ogc.dmsolutions.ca/wfs/1.1.0/wfs.xsd" timeStamp="" numberOfFeatures="2">
</wfs:FeatureCollection>

12 changes: 12 additions & 0 deletions wxs/expected/wfs_filter_postgis_filter_item_hits_start_index.xml
@@ -0,0 +1,12 @@
Content-Type: text/xml; subtype=gml/3.1.1; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<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/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=province_with_filter_item&amp;OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://ogc.dmsolutions.ca/wfs/1.1.0/wfs.xsd" timeStamp="" numberOfFeatures="1">
</wfs:FeatureCollection>

12 changes: 12 additions & 0 deletions wxs/expected/wfs_filter_postgis_property_is_equal_hits.xml
@@ -0,0 +1,12 @@
Content-Type: text/xml; subtype=gml/3.1.1; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<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/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=popplace&amp;OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://ogc.dmsolutions.ca/wfs/1.1.0/wfs.xsd" timeStamp="" numberOfFeatures="1">
</wfs:FeatureCollection>

32 changes: 30 additions & 2 deletions wxs/wfs_filter_postgis.map
Expand Up @@ -132,6 +132,15 @@
# Filter using startIndex
# RUN_PARMS: wfs_filter_postgis_startindex.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=popplace&propertyname=(name)&maxfeatures=10&startindex=0" > [RESULT]
# RUN_PARMS: wfs_filter_postgis_startindex2.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=popplace&propertyname=(name)&maxfeatures=10&startindex=10" > [RESULT]
#
# Filter and RESULTTYPE=hits (RFC 114)
# RUN_PARMS: wfs_filter_postgis_property_is_equal_hits.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=popplace&RESULTTYPE=hits&FILTER=<Filter><PropertyIsEqualTo><PropertyName>name</PropertyName><Literal>Digby</Literal></PropertyIsEqualTo></Filter>" > [RESULT_DEVERSION]
# RUN_PARMS: wfs_filter_postgis_bbox_hits.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=popplace&RESULTTYPE=hits&FILTER=<Filter><BBOX><PropertyName>POINT</PropertyName><Box+srsName=%22CRS:84%22><coordinates>-65.86,44.56+-65.76,44.68</coordinates></Box></BBOX></Filter>" > [RESULT_DEVERSION]
#
# Filter and FilterItem and RESULTTYPE=hits (RFC 114)
# RUN_PARMS: wfs_filter_postgis_filter_item_hits.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=province_with_filter_item&RESULTTYPE=hits" > [RESULT_DEVERSION]
# RUN_PARMS: wfs_filter_postgis_filter_item_hits_start_index.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=province_with_filter_item&RESULTTYPE=hits&STARTINDEX=1" > [RESULT_DEVERSION]

MAP
#CONFIG "MS_ERRORFILE" "stderr"
NAME WFS_FILTER
Expand Down Expand Up @@ -182,7 +191,6 @@ LAYER
METADATA
"wfs_title" "province"
"wfs_description" "province"
"wfs_result_fields" "NAME_E YEAR_EST AREA_KMSQ"
"gml_include_items" "all"
END
TYPE POLYGON
Expand All @@ -209,7 +217,6 @@ LAYER
METADATA
"wfs_title" "popplace"
"wfs_description" "Cities"
"wfs_result_fields" "name"
"gml_include_items" "all"
END
TYPE POINT
Expand Down Expand Up @@ -240,4 +247,25 @@ LAYER
END
END # Layer


LAYER
NAME province_with_filter_item
INCLUDE "postgis.include"
DATA "the_geom from (select * from province order by gid) as foo using srid=3978 using unique gid"
FILTER 'Cape Breton Island'
FILTERITEM 'island_e'
METADATA
"wfs_title" "province_with_filter_item"
"wfs_description" "province_with_filter_item"
"gml_include_items" "all"
END
TYPE POLYGON
STATUS ON
PROJECTION
"init=epsg:3978"
END

END # Layer


END # Map File

0 comments on commit 05e8264

Please sign in to comment.