It's been reported to me by a developer that when they are performing WFS getfeature requests on ArcGIS Servers (both 10.6.1 & 10.9.1) with PropertyName, an invalid geojson is returned (if requested as the output format). A propertyName request will result in a dangling comma in the geometry field (making in invalid). There appears to be an assumption in the geojson template that there will always be a "coordinate" in associated feature to fill in this section before the closing curly bracket.
Example WFS request:
https://services.ga.gov.au/gis/services/Topographic_Map_Indexes/mapserver/wfsserver?request=GetFeature&service=WFS&version=2.0.0&outputFormat=geojson&typeName=Topographic_Map_Indexes:General_Reference_Maps_Index_1Million&startIndex=0&maxFeatures=100000&propertyName=MAP_NUM
Example Output:
{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"features":[
{"type":"Feature","geometry":{"type":"multipolygon",},"properties":{"GmlID":"General_Reference_Maps_Index_1Million.1","objectid":1,"MAP_NUM":"SG54","st_area_shape_":24.00000000,"st_perimeter_shape_":20.00000000}},
{"type":"Feature","geometry":{"type":"MultiPolygon",},"properties":{"GmlID":"General_Reference_Maps_Index_1Million.2","objectid":2,"MAP_NUM":"SG55","st_area_shape_":24.00000000,"st_perimeter_shape_":20.00000000}},
(note "geometry":{"type":"MultiPolygon",},)
This doesn't appear to be an issue when outputting an xml file as the geometry field appears to be ignored:
eg.
https://services.ga.gov.au/gis/services/Topographic_Map_Indexes/mapserver/wfsserver?request=GetFeature&service=WFS&version=2.0.0&typeName=Topographic_Map_Indexes:General_Reference_Maps_Index_1Million&startIndex=0&maxFeatures=100000&propertyName=MAP_NUM
Example Output:
<Topographic_Map_Indexes:General_Reference_Maps_Index_1Million gml:id="General_Reference_Maps_Index_1Million.1">
<Topographic_Map_Indexes:objectid>1</Topographic_Map_Indexes:objectid>
<Topographic_Map_Indexes:MAP_NUM>SG54</Topographic_Map_Indexes:MAP_NUM>
<Topographic_Map_Indexes:st_area_shape_>24.00000000</Topographic_Map_Indexes:st_area_shape_>
<Topographic_Map_Indexes:st_perimeter_shape_>20.00000000</Topographic_Map_Indexes:st_perimeter_shape_>
</Topographic_Map_Indexes:General_Reference_Maps_Index_1Million>
When testing a similar requests on geoserver, the result will return "null" for the "geometry" and continue to generate a valid json output.
Example request on geoserver:
https://services.ga.gov.au/gis/earthresource/wfs?request=GetFeature&version=2.0.0&service=WFS&outputFormat=application%2Fjson&typeName=ProcessingPlants&propertyName=PLANT_NAME
Example Output:
{"type":"FeatureCollection","features":[{"type":"Feature","id":"ProcessingPlants.42000","geometry":null,"properties":{"ENO":42000,"PLANT_NAME":"Kwinana - Fe"}},{"type":"Feature","id":"ProcessingPlants.42096","geometry":null,"properties":{"ENO":42096,"PLANT_NAME":"Bell Bay"}},{"type":"Feature","id":"ProcessingPlants.42097","geometry":null,"properties":{"ENO":42097,"PLANT_NAME":"Bell Bay - Mn"}},
A work around has been found by not specifying the "&propertyName=" when querying ArcGIS servers, but I believe that the above is still a valid request and the servers should be able to handle a response without a coordinate.
I logged a call with our local ESRI support, but was advised that this was expected behaviour and to not use the "&propertyName=" option.
Just wondering if anyone where has any further ideas?