ArcGIS JSON to GeoJSON does not always work

7882
14
03-19-2014 04:02 AM
GregoryGiguashvili
New Contributor
I'm reading ArcGIS Server responses with conversion to GeoJSON format as described in http://gis.stackexchange.com/questions/13029/how-to-convert-arcgis-server-json-to-geojson post.

1. I've tried to search any explanation on how this conversion works, but I could not find anything. Could anyone provide pointers to how this query-based conversion works in general?

2. The above mentioned technique does not work for some Feature Server layers, returning empty results.
This one works fine:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer...

This one returns empty result:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/F...

Could anyone explain why and how the problem may be solved?

Thanks a lot
Giga
0 Kudos
14 Replies
JeffJacobson
Occasional Contributor III
Have you tried using Esri's Terraformer libraries to do the conversion?
0 Kudos
GregoryGiguashvili
New Contributor
The problem is that Esri/Terraformer parser is written in JS and my project is cross-platform C++ on the client side. I've seen this tool and I may be forced to use it in some awkward way if there're no other choices. Also, the main reason for not using Esri C++ libraries is the lack of 64 bit cross-platform support.

Any pointers on how and why the URL query works at all? Is it some kind of an undocumented behavior with Ersi ArcGIS?
0 Kudos
AnttiKajanus1
Occasional Contributor III
I tested the services by using query tool that is provided by REST endpoint by :

1) QUERY it seems to return results.

2) QUERY seems to return no results so I guess the service is empty so it returns correct information.

Can you specify your current problem in more detail since I didn't get that.
0 Kudos
GregoryGiguashvili
New Contributor
My problem is that I need GeoJSON output from ArcGIS server because that's what my GDAL-based client application expects to process. The queries that I posted in my initial question use a technique for converting Esri JSON to GeoJSON by providing "query?where=objectid+%3D+objectid&outfields=*&f=pjson" suffix to the service URL. This technique is described in http://gis.stackexchange.com/questions/13029/how-to-convert-arcgis-server-json-to-geojson post, but it's not explained.

My questions boil down to:
1. How the mentioned conversion technique works in general?
2. Why the technique does not work for some layers?

Thanks a lot
Giga
0 Kudos
nicogis
MVP Frequent Contributor
you can create a soe. Here you can see an example: http://blog.geomusings.com/2013/06/10/geojson-from-arcgis-server/
0 Kudos
GregoryGiguashvili
New Contributor
you can create a soe. Here you can see an example: http://blog.geomusings.com/2013/06/10/geojson-from-arcgis-server/

Unfortunately, Server Object Extension (SOE) is not helpful because we do not control what extensions are installed on the customer servers. We're interested to get the converted data from server using techniques officially supported by Esri, or convert the data on the client side.
0 Kudos
GregoryGiguashvili
New Contributor
Have you tried using Esri's Terraformer libraries to do the conversion?

I'm now trying to use Terraformer for converting ArcGIS JSON to GeoJSON, so that it's later processed by GDAL/OGR library. Are there any pointers on how to supply a proper query to ArcGIS server so that the output can be fed into Terraformer.ArcGIS.parse function?
0 Kudos
nicogis
MVP Frequent Contributor
Ok, if you need make it client side you can run your query (arcgis js) and then you can use https://github.com/Esri/geojson-utils/blob/master/src/jsonConverters.js and convert featureset in geojson
0 Kudos
MarcoBoeringa
MVP Regular Contributor
Unfortunately, Server Object Extension (SOE) is not helpful because we do not control what extensions are installed on the customer servers. We're interested to get the converted data from server using techniques officially supported by Esri, or convert the data on the client side.


Looking at that blog that Domenico pointed out, and the tools ESRI seem to offer to deploy such a SOE on the server as presented therein, I wouldn't consider SOEs "unsupported techniques" in the context of ArcGIS for Server...
0 Kudos