I put together a simple geo-converter a while back (and posted about it) that converts geojson to arcjson\esrijson. I needed it to get some polygons in an arcgis feature service. I have updated that converter to also convert from arcjson to geojson as well. I used it to pull arcjson from an ArcGIS Feature Service via a query against the REST API and convert the results to geojson.
The geoconverter tool
I pulled the arcjson formatted data from City of Fort Collins ArcGIS web services
A query against the Neighborhoods layer, like so:
Results into the geoconverter
Created a MapBox map with it
And here’s some geojson to try out, Major League Baseball Stadiums
So I put together a dead simple interface to convert geojson to arcjson using the esri geojson utils repo on github. I also threw in a feature to view it on a map, but its spotty…
It truly is a wrapper around geojson utils.
Include, create, use
I ended up doing this for a few reasons: I wanted to try out the awesome geoJson creation and editing tool by @tmcw, geojson.io. And I also wanted to play with the new Boostrap 3 flatness, a significant departure from the old version in both workings and looks.
The new developers.arcgis.com allowed me to quickly create and publish a new feature service to contain the new data. I just copied the output from geojson.io, pasted it into a text box, hit the button and I had arcJson. Another copy and paste to get it into the feature service rest endpoint, addFeatures and I had my regions in my map service.
A note that if you need the same workflow you need to ‘unwrap’ the output arcjson into just the array of features i.e. remove the outter ‘features’ object before pasting into an addFeatures end point. Peel off this bit here and the very last curly too:
Definitely ‘innovation time’ as this is just a bridge across the open water until esri provides full support for geojson. Let me know if you find it useful.