1

I am working with filters for ArcGIS for Server, the documentation of ArcGIS is not helping me a lot. I am trying to retrieve a point inside a polygon but when I run the filter no results are shown. I am starting to use filters in WFS request so my skills are not good, maybe the solution is something simple.

Here is my filter in XML:

<?xml version="1.0" encoding="utf-8" ?>
<wfs:StoredQueryList
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:fes="http://www.opengis.net/fes/2.0"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:myns="http://www.someserver.com/myns"
  xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd"
  service="WFS"
  version="2.0.0">
  <wfs:StoredQueryDefinition id="urn:StoredQueries:WithinSpatial">
    <wfs:Title>WithinSpatial</wfs:Title>
    <wfs:Abstract>Filter by polygon</wfs:Abstract>
    <wfs:QueryExpressionText
    returnFeatureTypes="q.public.upload_noise_data"
    language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"
    isPrivate="false">
      <wfs:Query typeName="q.public.upload_noise_data">
        <fes:Filter>
          <fes:Within>
            <fes:PropertyName>location</fes:PropertyName>
            <gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>9.10592032253008,40.8116819881764 10.5104394915079,40.7819567147588 10.5178708098622,39.5557891862862 9.12821427759322,39.5855144597037 9.10592032253008,40.8116819881764</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>
          </fes:Within>
        </fes:Filter>
      </wfs:Query>
    </wfs:QueryExpressionText>
  </wfs:StoredQueryDefinition>
</wfs:StoredQueryList>

Here the point that must appear when I run the filter in GML format:

      <wfs:member>
    <Points_test:q.public.upload_noise_data gml:id="q.public.upload_noise_data.4">
      <Points_test:date_of_operation>2017-09-05T00:00:00</Points_test:date_of_operation>
      <Points_test:proxy>gfs</Points_test:proxy>
      <Points_test:source_spectra>dwwde</Points_test:source_spectra>
      <Points_test:duty_cycle>0</Points_test:duty_cycle>
      <Points_test:start_time>2017-09-05T11:14:38</Points_test:start_time>
      <Points_test:end_time>2017-09-06T11:14:52</Points_test:end_time>
      <Points_test:directivity>wddwq1aq</Points_test:directivity>
      <Points_test:source_depth>60</Points_test:source_depth>
      <Points_test:platform_speed>35</Points_test:platform_speed>
      <Points_test:sel>56</Points_test:sel>
      <Points_test:spl>29</Points_test:spl>
      <Points_test:source_event>Seismic</Points_test:source_event>
      <Points_test:location><gml:Point gml:id="q.public.upload_noise_data.4.pn.0" srsName="urn:ogc:def:crs:EPSG::4326"><gml:pos>10.00000000000006 40.00000000000006</gml:pos></gml:Point></Points_test:location>
      <Points_test:lat>40</Points_test:lat>
      <Points_test:lon>10</Points_test:lon>
    </Points_test:q.public.upload_noise_data>
  </wfs:member>

Here is the Filter Capabilities

  <fes:Filter_Capabilities>
  <fes:Conformance>
    <fes:Constraint name="ImplementsQuery"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsAdHocQuery"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsFunctions"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsResourceId"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsMinStandardFilter"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsStandardFilter"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsMinSpatialFilter"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsSpatialFilter"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsMinTemporalFilter"><ows:NoValues/><ows:DefaultValue>FALSE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsTemporalFilter"><ows:NoValues/><ows:DefaultValue>FALSE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsVersionNav"><ows:NoValues/><ows:DefaultValue>FALSE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsSorting"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsExtendedOperators"><ows:NoValues/><ows:DefaultValue>FALSE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsMinimumXPath"><ows:NoValues/><ows:DefaultValue>TRUE</ows:DefaultValue></fes:Constraint>
    <fes:Constraint name="ImplementsSchemaElementFunc"><ows:NoValues/><ows:DefaultValue>FALSE</ows:DefaultValue></fes:Constraint>
  </fes:Conformance>
  <fes:Id_Capabilities>
    <fes:ResourceIdentifier name="fes:ResourceId"/>
  </fes:Id_Capabilities>
  <fes:Scalar_Capabilities>
    <fes:LogicalOperators/>
    <fes:ComparisonOperators>
      <fes:ComparisonOperator name="PropertyIsEqualTo"/>
      <fes:ComparisonOperator name="PropertyIsNotEqualTo"/>
      <fes:ComparisonOperator name="PropertyIsLessThan"/>
      <fes:ComparisonOperator name="PropertyIsGreaterThan"/>
      <fes:ComparisonOperator name="PropertyIsLessThanOrEqualTo"/>
      <fes:ComparisonOperator name="PropertyIsGreaterThanOrEqualTo"/>
      <fes:ComparisonOperator name="PropertyIsLike"/>
      <fes:ComparisonOperator name="PropertyIsNull"/>
      <fes:ComparisonOperator name="PropertyIsNil"/>
      <fes:ComparisonOperator name="PropertyIsBetween"/>
    </fes:ComparisonOperators>
  </fes:Scalar_Capabilities>
  <fes:Spatial_Capabilities>
    <fes:GeometryOperands xmlns:gml="http://www.opengis.net/gml" xmlns:gml32="http://www.opengis.net/gml">
      <fes:GeometryOperand name="gml:Box"/>
      <fes:GeometryOperand name="gml:Envelope"/>
      <fes:GeometryOperand name="gml:Point"/>
      <fes:GeometryOperand name="gml:LineString"/>
      <fes:GeometryOperand name="gml:LinearRing"/>
      <fes:GeometryOperand name="gml:Polygon"/>
      <fes:GeometryOperand name="gml:MultiPoint"/>
      <fes:GeometryOperand name="gml:MultiCurve"/>
      <fes:GeometryOperand name="gml:MultiSurface"/>
    </fes:GeometryOperands>
    <fes:SpatialOperators>
      <fes:SpatialOperator name="BBOX"/>
      <fes:SpatialOperator name="Equals"/>
      <fes:SpatialOperator name="Disjoint"/>
      <fes:SpatialOperator name="Intersects"/>
      <fes:SpatialOperator name="Touches"/>
      <fes:SpatialOperator name="Crosses"/>
      <fes:SpatialOperator name="Within"/>
      <fes:SpatialOperator name="Contains"/>
      <fes:SpatialOperator name="Overlaps"/>
      <fes:SpatialOperator name="Beyond"/>
      <fes:SpatialOperator name="DWithin"/>
    </fes:SpatialOperators>
  </fes:Spatial_Capabilities>
  </fes:Filter_Capabilities>

And finally this is my url to start the filter:

https://localhost:6443/arcgis/services/Points_test/MapServer/WFSServer?service=WFS&version=2.0.0&REQUEST=GetFeature&typeName=Points_test:q.public.upload_noise_data&STOREDQUERY_ID=urn:StoredQueries:WithinSpatial

The answer that I recieve is:

<wfs:FeatureCollection timeStamp="2017-09-08T10:41:05Z" numberMatched="unknown" numberReturned="0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd https:localhost:6443/arcgis/services/Points_test/MapServer/WFSServer https://localhost:6443/arcgis/services/Points_test/MapServer/WFSServer?service=wfs%26version=2.0.0%26request=DescribeFeatureType">
</wfs:FeatureCollection>

Is any type of documentation of filters available in order to continue my research?

  • typename is incorrect for WFS version 2.0.0 should be typenameS (case is not important for parameter names) – nmtoken Apr 4 '18 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.