I try to download data from the city of Rome with this command:
ogr2ogr -f GeoJSON EVC_rome.json "http://services2.arcgis.com/NZMqCJwY3kMjFOqf/arcgis/rest/services/ricarica_elettrica/FeatureServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json" OGRGeoJSON -gt 1000
The OSGeo4Q Shell says "unable to open datasource `http://services2.arcgis.com/NZMqCJwY3kMjFOqf/arcgis/rest/services/ricarica_elettrica/FeatureServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json' with the following drivers."
Any ideas?
1 Answer 1
Just taking your url and copying it into the browser I get back:
{"error":{"code":400,"message":"Cannot perform query. Invalid query parameters.","details":["'Invalid field: objectid' parameter is invalid"]}}
So the issue is in your url format.
http://services2.arcgis.com/NZMqCJwY3kMjFOqf/ArcGIS/rest/services/ricarica_elettrica/FeatureServer/0/query?where=1%3D1&objectIds&returnGeometry=true&f=json works so it's how you are forming your url..
-
Great, it works. But now I get this error:"EPSG PCS/GCS code 102100 not found in EPSG support files. Is this a valid EPSG coordinate system?" The spatial reference is stored here
spatialReference":{"wkid":102100,"latestWkid":3857}
Any idea how I can select the latestWkid?Alexejevitsch– Alexejevitsch2017年04月13日 14:50:03 +00:00Commented Apr 13, 2017 at 14:50 -
If you look at resources.arcgis.com/en/help/arcgis-rest-api/index.html#/… you will see 102100 and 3857 are the same. For the Esri rest service I would just substitute 3857 for 102100 in the URL. I would test it to see if it's giving you the correct locations,Bill Chappell– Bill Chappell2017年04月13日 18:16:49 +00:00Commented Apr 13, 2017 at 18:16