[GIS] WMS GetMap Request with featureid CQL filter

cql-filterwfswms

I have WMS and WFS services available to me and am trying to do the following:

I am trying to identify images(features) within a given BBOX using WFS, and then I want to retrieve the individual images through WMS GetMap based on the featureid from the WFS call.

The WFS query that I make is (URL modified to hide actual server information):
http://www.wfsserver.com/catalogservice/wfsaccess/REQUEST=GetFeature&typeName=FinishedFeature&SERVICE=WFS&VERSION=1.1.0&BBOX=-73.8854994266476,40.6341176876158,-73.8606463081034,40.6501752378911,EPSG:4326&WIDTH=512&HEIGHT=512

My understanding of the above query:

  • I specify WFS as the service and GetFeature as the REQUEST type to pull metadata for the features.
  • I specify FinishedFeature as the feature type to get the data from (this is the name of the feature type that I happen to be using).
  • I specify a BBOX to restrict the area for which I want to pull the features from and specify EPSG:4326 as the SRS for the BBOX.
  • Width and Height is set to 512 (I don't know how this affects anything since I can change the values and still get the same results).

What I get in response is a Feature Collection GML that lists several Features for the BBOX that I specified.

<wfs:FeatureCollection xmlns:ogc="http://www.opengis.net/ogc" 
                       xmlns:wfs="http://www.opengis.net/wfs"
                       xmlns:ows="http://www.opengis.net/ows" 
                       xmlns:xlink="http://www.w3.org/1999/xlink" 
                       xmlns:gml="http://www.opengis.net/gml" 
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                       numberOfFeatures="21" timeStamp="2015-09-21T17:06:45.806Z"
                       xsi:schemaLocation="http://www.myServer.com">
    <gml:featureMembers>
        <FinishedFeature gml:id="16478949f5fc3c87ba329fcf608085a3">
            <featureId>16478949f5fc3c87ba329fcf608085a3</featureId>
            <geometry>
                 <gml:Polygon srsDimension="2" srsName="urn:x-ogc:def:crs:EPSG:4326">
                     <gml:exterior>
                         <gml:LinearRing srsDimension="2">
                             <gml:posList>
                                 40.81988700000292 -73.95899850000016 40.63913550005475 -73.95894900000025 40.64983200005168 -73.73234250038556 40.83001650000002 -73.7327880003848 40.81988700000292 -73.95899850000016
                             </gml:posList>
                         </gml:LinearRing>
                     </gml:exterior>
                 </gml:Polygon>
             </geometry>
             <acquisitionDate>2015-09-03 17:32:02</acquisitionDate>
             ............... and so forth

The WMS query that I do following the WFS query is:

https://www.wmsserver.com/mapservice/wmsaccess/SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=Imagery&FORMAT=image%2Fjpeg&HEIGHT=512&WIDTH=512&SRS=EPSG:4326&BBOX=-73.70,40.60,-74.00,40.85&CQL_FILTER=featureid=%27464fd8ace00f7e8de1b0976b51a83042%27

My understanding of the above WMS query:

  • I specify WMS as the service and GetMap as the REQUEST type in order to retrive the image.
  • I specify Imagery as my layer (Not what it's actually named, but it's what I'm calling it here)
  • I specify JPEG as the imagery format.
  • I specify 512×512 for width and height, and that is the size the image gets returned in.
  • I specify EPSG:4326 to specify the SRS for the BBOX.
  • I specify the CQL_FILTER for a featureid filter and give the featureid that I got form the WFS query.

When I run the query without the CQL_FILTER, I get an image. However, the image appears to be a merging of all the images for that given BBOX. I thought that specifying the CQL_FILTER on featureid would give me the one specific image instead of all the images. So, when I do apply the CQL_FILTER, what I get is a blank image that is all white. Running all the features and their featureid through the CQL_FILTER will give me a single white image for every single one.

In my head, what I am doing is very simple: Get all of the images (features) within a given BBOX using WFS. Run results through WMS GetMap with a featureid CQL Filter to get all the images individually from within that BBOX.

Is there anything that I am doing which is obviously wrong? Could this be a problem with our server?

Best Answer

In the very end, I got a response from the vendor a month after we stopped working on the project. The vendor's response was that I was using the wrong letter casing in the CQL_FILTER parameters. The 'featureid' parameter needed to have a capital 'i' so that it ends up as 'featureId'. I tested my original WMS query with the single letter change, and sure enough, my original WMS query worked great.