Possible Duplicate:
How to convert ArcGIS Server JSON to GeoJSON?
How to convert ArcGIS Javascript api Geometry Object to GeoJson using Javascript?
-
This looks similar to the question I asked here: gis.stackexchange.com/questions/13029/…Tanner– Tanner2012年03月19日 18:54:21 +00:00Commented Mar 19, 2012 at 18:54
-
2@Tanner good call, I voted to close this as an exact duplicate.Derek Swingley– Derek Swingley2012年03月19日 19:04:03 +00:00Commented Mar 19, 2012 at 19:04
2 Answers 2
You can do it client-side in JavaScript. You can check the source out here. https://github.com/odoe/esritogeo
And I've started implementing the same thing in python, but in both directions. https://github.com/odoe/SpatialJSON
Here is a sample where you can use JavaScript to convert the results of an Esri map service query to GeoJSON to use in Leaflet https://gist.github.com/2424223
The geometry object has a method, toJson(), that will do this for you: Javascript API Reference
-
1That method generates an object. It doesn't generate an object that conforms to the GeoJSON spec.Derek Swingley– Derek Swingley2012年03月19日 18:26:26 +00:00Commented Mar 19, 2012 at 18:26
-
1Yes,toJson() method will return EsriJSON.But I want GeoJSON format.SureshRajamani– SureshRajamani2012年03月20日 12:20:58 +00:00Commented Mar 20, 2012 at 12:20