1

I have a large ESRI json (which I got from a request at an ESRI Rest API) that I need to convert to some sort of vector file, preferably a Shapefile.

It seems there are ways of doing this using ArcPy, but I do not own an ArcGIS license. Is there a way to work around this or is ArcGIS the only way to do it?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • 1
    Use GDAL. Ogr2ogr http://www.gdal.org/ogr2ogr.html and esrijson driver http://www.gdal.org/drv_esrijson.html. In released versions ESRI json is read with the GeoJSON driver but from user point of view it does not make sense. – user30184 Nov 16 '17 at 19:38
  • @user30184 Thanks for your reply. I'm still a bit confused since I don't have a deep understanding of GDAL beyond a little "rgdal" in R.

    1.- The ESRI json driver seems to be available only on GDAL 2.3 but the latest released version is 2.1, if I'm correct. How could I use an unreleased version? (I'm using MacOS)

    2.- You stated that in released versions of GDAL, ESRI json files are read with the GeoJSON driver. I tried doing that in R (with the "rgdal" package function "readOGR()") which has the GeoJSON driver, but I'm still unable to read the file.

    Any suggestions?

    Thanks!

    – Daniel Villarroel Torrez Nov 17 '17 at 19:38
  • Can you share some small sample of data? – user30184 Nov 17 '17 at 20:28
  • Or try yourself. Download some data and run ogrinfo your_file.json. – user30184 Nov 17 '17 at 20:57
  • @user30184 Here is the result of a query for one polygon. I tried saving it as JSON and running ogrInfo on it (in R) but I get or "Cannot open data source", or "Cannot open layer" if I specify the layer name as the file. – Daniel Villarroel Torrez Nov 18 '17 at 17:27
  • I would send mail to gdal-dev mailing list. Perhaps this json file is somehow special. – user30184 Nov 18 '17 at 21:32
  • Did you try exactly that response. With this result, it is a strong job to guess the right geometry type and srs. If you look on drv_esrijsom.html page they use, a layer query result, which also returns the layer structure. – Andreas W. Bartels Nov 20 '17 at 12:07

0 Answers0