WFS - Web Feature Service - Test Cases

1. Test that we get a GetCapabilities WFS response in XML

MAP-86,
MAP-87
1a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

1b. Using the header X-API-KEY with the value from step 14a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetCapabilities

1c. After sending a message, the response should look like:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:WFS_Capabilities xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns="http://www.opengis.net/wfs/2.0" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
    <ows:ServiceIdentification>
        <ows:Title>OSM Features</ows:Title>
        <ows:Abstract>A test OSM roads feature map.</ows:Abstract>

...

                <fes:TemporalOperator name="During"/>
            </fes:TemporalOperators>
        </fes:Temporal_Capabilities>
    </fes:Filter_Capabilities>
</wfs:WFS_Capabilities>

2. Test that we get a DescribeFeatureType WFS response in XML

MAP-91,
MAP-92
2a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

2b. Using the header X-API-KEY with the value from step 15a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=DescribeFeatureType&typename=test_roads

2c. After sending a message, the response should look like:

<?xml version='1.0' encoding="UTF-8" ?>
<schema
   targetNamespace="http://mapserver.gis.umn.edu/mapserver" 
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"

...

                </sequence>
            </extension>
        </complexContent>
    </complexType>
</schema>

3. Test that we get a GetFeature WFS response in XML

MAP-100,
MAP-102
3a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

3b. Using the header X-API-KEY with the value from step 16a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetFeature&typenames=test_roads&count=5

3c. After sending a message, the response should look like:

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"

...

            <ms:access_type>yes</ms:access_type>
            <ms:service>none</ms:service>
        </ms:test_roads>
    </wfs:member>
</wfs:FeatureCollection>

4. Test that we get a GetFeature WFS response in XML using a Logic Query

MAP-102
4a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

4b. Using the header X-API-KEY with the value from step 17a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetFeature&typenames=test_roads&count=5&filter=<Filter><PropertyIsEqualTo><PropertyName>street_name</PropertyName><Literal>Fayetteville Road</Literal></PropertyIsEqualTo></Filter>

4c. After sending a message, the response should look like:

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"

...

            <ms:service>none</ms:service>
        </ms:test_roads>
    </wfs:member>
</wfs:FeatureCollection>

5. Test that we get a GetFeature WFS response in XML using a Spatial Query

MAP-101
5a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

5b. Using the header X-API-KEY with the value from step 18a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=1.0.0&request=GetFeature&typenames=test_roads&count=5&filter=<Filter><BBOX><Box srsName='EPSG:4326'><coordinates>-78.653373,35.727097 -78.642274,35.736211</coordinates></Box></BBOX></Filter>

5c. After sending a message, the response should look like:

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
   xmlns:wfs="http://www.opengis.net/wfs"
   xmlns:gml="http://www.opengis.net/gml"

...

            <ms:access_type>yes</ms:access_type>
            <ms:service>none</ms:service>
        </ms:test_roads>
    </gml:featureMember>
</wfs:FeatureCollection>

6. Test that we get a GetFeature WFS response in CSV format

MAP-100
6a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

6b. Using the header X-API-KEY with the value from step 19a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetFeature&typenames=test_roads&count=5&outputformat=text/csv

6c. After sending a message, the response should look like:

WKT,id,osm_id,osm_timestamp,changeset,highway_type,street_name,street_name_alternate,bicycle_flag,foot_traffic_flag,horse_traffic_flag,golf_cart_flag,wheel_chair_flag,one_way_flag,tunnel_flag,covered_flag,bridge_flag,toll_flag,travel_lanes,speed_limit,draw_layer,sidewalk,surface,access_type,service
"LINESTRING (-78.6499870058665 35.727097,-78.6499752 35.7271895,-78.6499719 35.7274146,-78.6499832 35.7276351,-78.650044 35.727973,-78.6501124 35.7282572,-78.6503291 35.7290055)","5359831","98394526",2016/07/11 21:39:43+00,"40667198",trunk,Fayetteville Road,,"0","0","0","0","0","1","0","0","0","0","2","0","0",none,asphalt,yes,none
"LINESTRING (-78.6494630995816 35.727097,-78.64948 35.727133,-78.649965 35.728265,-78.6503291 35.7290055)","5423952","111782105",2016/05/28 17:25:41+00,"39628455",trunk,"US 70;NC 50",,"0","0","0","0","0","1","0","0","0","0","2",45 mph,"0",none,paved,yes,none
"LINESTRING (-78.642306 35.727975,-78.643331 35.727926,-78.643687 35.727911,-78.644147 35.727893,-78.64493 35.727907,-78.645112 35.727888,-78.645365 35.727825,-78.645791 35.727826,-78.646601 35.727871,-78.646811 35.727872)","3644060","18888230",2013/01/03 23:45:47+00,"14520528",residential,Leagan Drive,,"0","0","0","0","0","0","0","0","0","0","0","0","0",none,paved,yes,none
"LINESTRING (-78.651229 35.733963,-78.6509388 35.7339323)","3645572","18890474",2012/03/02 13:28:53+00,"10848324",residential,Olympia Drive,,"0","0","0","0","0","0","0","0","0","0","0","0","0",none,paved,yes,none
"LINESTRING (-78.644879 35.733401,-78.644883 35.732021,-78.644884 35.73197,-78.644885 35.731493,-78.6449073 35.7303027,-78.644923 35.729467,-78.644926 35.728815,-78.644955 35.728315,-78.64493 35.727907,-78.644935 35.727723,-78.64494 35.727494,-78.6449500315856 35.727097)","3658096","18905958",2015/07/01 15:36:24+00,"32334632",residential,Durham Drive,,"0","0","0","0","0","0","0","0","0","0","0","0","0",none,paved,yes,none

7. Test that we get a GetFeature WFS response in GeoJSON format

MAP-100
7a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

7b. Using the header X-API-KEY with the value from step 20a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetFeature&typenames=test_roads&count=5&outputformat=application/json

7c. After sending a message, the response should look like:

{
    "name": "test_roads",
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": 5359831,
            "geometry": {
                "type": "MultiLineString",
                "coordinates": [
                    [
                        [
                            -78.64998701,
                            35.72709700

...

            "properties": {
                "osm_id": "18905958",
                "osm_timestamp": "2015/07/01 15:36:24+00",
                "changeset": "32334632",
                "highway_type": "residential",
                "street_name": "Durham Drive",
                "street_name_alternate": "",
                "bicycle_flag": "0",
                "foot_traffic_flag": "0",
                "horse_traffic_flag": "0",
                "golf_cart_flag": "0",
                "wheel_chair_flag": "0",
                "one_way_flag": "0",
                "tunnel_flag": "0",
                "covered_flag": "0",
                "bridge_flag": "0",
                "toll_flag": "0",
                "travel_lanes": "0",
                "speed_limit": "0",
                "draw_layer": "0",
                "sidewalk": "none",
                "surface": "paved",
                "access_type": "yes",
                "service": "none"
            }
        }
    ]
}

8. Test that we get a GetPropertyValue WFS response in XML

MAP-96
8a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

8b. Using the header X-API-KEY with the value from step 21a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=GetPropertyValue&typenames=test_roads&valuereference=highway_type&sortby=highway_type ASC

8c. After sending a message, the response should look like:

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:ValueCollection
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"

...

    </wfs:member>
    <wfs:member>
        <ms:highway_type>unclassified</ms:highway_type>
    </wfs:member>
</wfs:ValueCollection>

9. Test that we get a ListStoredQueries WFS response in XML

MAP-104,
MAP-105
9a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

9b. Using the header X-API-KEY with the value from step 22a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=ListStoredQueries

9c. After sending a message, the response should look like:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:ListStoredQueriesResponse xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wfs/2.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
    <StoredQuery id="urn:ogc:def:query:OGC-WFS::GetFeatureById">
        <Title>Get feature by identifier</Title>
        <ReturnFeatureType xmlns:ms="http://mapserver.gis.umn.edu/mapserver">ms:test_roads</ReturnFeatureType>
    </StoredQuery>
</wfs:ListStoredQueriesResponse>

10. Test that we get a DescribeStoredQueries WFS response in XML

MAP-111,
MAP-112
10a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

10b. Using the header X-API-KEY with the value from step 23a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&service=WFS&version=2.0.0&request=DescribeStoredQueries&storedquery_id=urn:ogc:def:query:OGC-WFS::GetFeatureById

10c. After sending a message, the response should look like:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:DescribeStoredQueriesResponse xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wfs/2.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
    <StoredQueryDescription id="urn:ogc:def:query:OGC-WFS::GetFeatureById">
        <Title>Get feature by identifier</Title>
        <Abstract>Returns the single feature whose value is equal to the specified value of the ID argument</Abstract>
        <Parameter xmlns:xs="http://www.w3.org/2001/XMLSchema" name="ID" type="xs:string"/>
        <QueryExpressionText xmlns:ms="http://mapserver.gis.umn.edu/mapserver" isPrivate="true" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" returnFeatureTypes="ms:test_roads"/>
    </StoredQueryDescription>
</wfs:DescribeStoredQueriesResponse>

11. Test that we get a GetMetadata WFS response in XML

MAP-126,
MAP-127,
MAP-128
11a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wfs"
}

Note: the map_name key is optional.

11b. Using the header X-API-KEY with the value from step 24a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wfs&request=GetMetadata&layer=test_roads

11c. After sending a message, the response should look like:

<?xml version="1.0"?>
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd">
    <gmd:fileIdentifier>
        <gco:CharacterString>test_roads</gco:CharacterString>
    </gmd:fileIdentifier>

...

                </gmd:MD_DigitalTransferOptions>
            </gmd:transferOptions>
        </gmd:MD_Distribution>
    </gmd:distributionInfo>
</gmd:MD_Metadata>

12. Test that we get a 400 response when omitting the 'service' parameter

MAP-257
12a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wms"
}

Note: the map_name key is optional.

12b. Using the header X-API-KEY with the value from step 25a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wms&request=GetCapabilities

12c. After sending a message, the response should look like:

{
    "response": "failure",
    "message": "Parameter error: 'service' parameter is required."
}

13. Test that we get a 400 response when omitting the 'version' parameter

MAP-258
13a. Create a token using get_map_data as the resource, osm-tests-wfs as the map_name, tests as the project_name and using your test AppKey:

{
  "appkey": "insert-your-appkey-here",
  "resource": "get_map_data",
  "project_name": "tests",
  "map_name": "osm-tests-wms"
}

Note: the map_name key is optional.

13b. Using the header X-API-KEY with the value from step 26a, send a message using the following URL:

https://maptimus.certusview.com/api/v2/mapserver?project=tests&map=osm-tests-wms&service=WMS&request=GetCapabilities

13c. After sending a message, the response should look like:

{
    "response": "failure",
    "message": "Parameter error: 'version' parameter is required."
}