0

when I want to convert this FeatureServer as one GeoPackage using ogr2ogr on macOS, an error occurred with these messages

Warning 6: driver ESRIJSON does not support open option NATIVE_DATA ERROR 1: Invalid FeatureCollection object. Missing 'fields' member. ERROR 1: Layer schema generation failed. ERROR 4: Failed to read ESRIJSON data

the full ogr2ogr command :

ogr2ogr  -f  GPKG -skipfailures   floridaData.gpkg    "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/COVID19Surge_Florida_InterventionScenarios/FeatureServer/query?layerDefs=%7B%220%22%3A%22OBJECTID+%3C1000%22%2C%221%22%3A%22OBJECTID+%3C1000%22%7D&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outSR=4362&returnGeometry=true&sqlFormat=standard&f=json&maxRecordCountFactor=30&outFields=*&returnExceededLimitFeatures=false&resultType=tile" 

I don't know why it's not working, the link is working perfectly.

2
  • That isn't a WFS endpoint
    – Ian Turton
    Commented Oct 7, 2021 at 7:31
  • Sorry, I don't know that. I have edited it. Commented Oct 7, 2021 at 7:38

1 Answer 1

1

The ESRIJSON driver that is responsible for FeatureServer does not support handling multiple layers at the same time, you have to query layer per layer.

For example:

ogr2ogr -skipfailures  -f  GPKG floridaData.gpkg "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/COVID19Surge_Florida_InterventionScenarios/FeatureServer/0/query?where=OBJECTID+%3C1000&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outSR=4362&returnGeometry=true&sqlFormat=standard&f=json&maxRecordCountFactor=30&outFields=*&returnExceededLimitFeatures=false&resultType=tile" -nln 0
ogr2ogr -skipfailures -update floridaData.gpkg "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/COVID19Surge_Florida_InterventionScenarios/FeatureServer/1/query?where=OBJECTID+%3C1000&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outSR=4362&returnGeometry=true&sqlFormat=standard&f=json&maxRecordCountFactor=30&outFields=*&returnExceededLimitFeatures=false&resultType=tile" -nln 1

For more info

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.