[Geoserver-devel] [JIRA] (GEOS-9206) An incorrect POST request (missing PropertyName element in the BBOX fIlter) is generated by WFS-NG when querying an external ArcGIS WFS datastore

Luca Morandini created an issue

GeoServer / BugGEOS-9206

An incorrect POST request (missing PropertyName element in the BBOX fIlter) is generated by WFS-NG when querying an external ArcGIS WFS datastore

Issue Type:

BugBug

Affects Versions:

2.14.1, 2.15.2

Assignee:

Unassigned

Components:

WFS

Created:

09/May/19 1:52 PM

Priority:

MediumMedium

Reporter:

Luca Morandini

I added a WFS-NG data source pointing to an ArcGIS WFS service, dutifully added a few feature types, and started making WFS requests, such as:

curl -XGET 'http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=it.geosolutions:SLIP_Public_Services_Farming_WFS_Land_Capability_-_Vineyards__DPIRD-034_&bbox=12702086,-4182198,13719898,-3205475,EPSG:3857'

However, the POST request (I set prefer POST over GET since ArcGIS objects to the use of plus sign in lieu of %20 when URL-encoding spaces) that GeoServer sent lacked the BBOX/PropertyName element.

2019-05-08 16:40:21,331 DEBUG [org.geotools.data.wfs.requests] - Encoded GET_FEATURE request: <?xml version="1.0" encoding="UTF-8"?><wfs:GetFeature xmlns:SLIP_Public_Services_Farming_WFS="https:services.slip.wa.gov.au:443/arcgis/services/SLIP_Public_Services/Farming_WFS/MapServer/WFSServer" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xlink="http://www.w3.org/1999/xlink" handle="GeoTools 20-SNAPSHOT(62662e524ea61f01428d6a7b26a1c7690495ec14) WFS 1.1.0 DataStore @isenbrant#2" maxFeatures="1000000" outputFormat="text/xml; subType=gml/3.1.1/profiles/gmlsf/1.0.0/0" resultType="hits" service="WFS" version="1.1.0">
 <wfs:Query srsName="urn:ogc:def:crs:EPSG:6.9:3857" typeName="SLIP_Public_Services_Farming_WFS:Land_Capability_-_Vineyards__DPIRD-034_">
  <wfs:PropertyName>objectid</wfs:PropertyName>
  <wfs:PropertyName>decode</wfs:PropertyName>
  <wfs:PropertyName>lc_vines_c</wfs:PropertyName>
  <wfs:PropertyName>id</wfs:PropertyName>
  <wfs:PropertyName>shape</wfs:PropertyName>
  <wfs:PropertyName>st_area_shape_</wfs:PropertyName>
  <wfs:PropertyName>st_length_shape_</wfs:PropertyName>
  <ogc:Filter>
   <ogc:BBOX>
    <ogc:PropertyName/>
    <gml:Envelope srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#3857">
     <gml:lowerCorner>12702086 -4182198,</gml:lowerCorner>
     <gml:upperCorner>13719898 -3205475</gml:upperCorner>
    </gml:Envelope>
   </ogc:BBOX>
  </ogc:Filter>
 </wfs:Query>
</wfs:GetFeature>

Filling in the property name results in a successful response from ArcGIS:

curl -XPOST "https://services.slip.wa.gov.au:443/public/services/SLIP_Public_Services/Farming_WFS/MapServer/WFSServer"\
  --header "Content-Type:text/xml"\
  --data '<?xml version="1.0" encoding="UTF-8"?>
  <wfs:GetFeature xmlns:SLIP_Public_Services_Farming_WFS="https:services.slip.wa.gov.au:443/arcgis/services/SLIP_Public_Services/Farming_WFS/MapServer/WFSServer" 
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:wfs="http://www.opengis.net/wfs" 
  xmlns:gml="http://www.opengis.net/gml" 
  xmlns:ogc="http://www.opengis.net/ogc" 
  xmlns:ows="http://www.opengis.net/ows" 
  xmlns:xlink="http://www.w3.org/1999/xlink" handle="GeoTools 20-SNAPSHOT(62662e524ea61f01428d6a7b26a1c7690495ec14) WFS 1.1.0 DataStore @isenbrant#2" maxFeatures="3" 
  outputFormat="text/xml; subType=gml/3.1.1/profiles/gmlsf/1.0.0/0" 
  resultType="hits" 
  service="WFS" 
  version="1.1.0">
 <wfs:Query srsName="urn:ogc:def:crs:EPSG:6.9:3857" typeName="SLIP_Public_Services_Farming_WFS:Land_Capability_-_Vineyards__DPIRD-034_">
  <wfs:PropertyName>objectid</wfs:PropertyName>
  <wfs:PropertyName>decode</wfs:PropertyName>
  <wfs:PropertyName>lc_vines_c</wfs:PropertyName>
  <wfs:PropertyName>id</wfs:PropertyName>
  <wfs:PropertyName>shape</wfs:PropertyName>
  <wfs:PropertyName>st_area_shape_</wfs:PropertyName>
  <wfs:PropertyName>st_length_shape_</wfs:PropertyName>
  <ogc:Filter>
   <ogc:BBOX>
    <ogc:PropertyName>shape</ogc:PropertyName>
    <gml:Envelope srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#3857">
     <gml:lowerCorner>12702086 -4182198,</gml:lowerCorner>
     <gml:upperCorner>13719898 -3205475</gml:upperCorner>
    </gml:Envelope>
   </ogc:BBOX>
  </ogc:Filter>
 </wfs:Query>
</wfs:GetFeature>'

After instrumenting GeoServer 2.14, it turned out that the BaseFeatureKvpRequestReader class handleBBOX method does not set propertyName with the default geometry of the feature type; consequently, when the POST request is built, the PropertyName element is left blank, as in the BBOXImpl class the e1 expression is an empty string.

I replicated the issue on the current master branch as well.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100100-sha1:5dc2d5e)

Atlassian logo