[GIS] ESRI JSON-thingie from ArcGIS online

arcgis-10.0arcgis-onlinearcgis-rest-api

I try to download a web map from arcgis online into arcgis desktop. From the site I get a file named item.pkginfo and arcgis desktop opens it. Unfortunately it only gets me the basemap image and not the features.

According to the knowledgebase article 3824 from Esri, one can reach the data via the url after the tag but what i get is something looking like a long string of json-like data. (The esri-page doesnt say anything about the format one get.)

Haw anyone tried to extract data from arcgis online the same way and can tell the data-format of that string?

The datastring is this: http://www.arcgisonline.com/sharing/content/items/4dde65a4ffd846ff862ed6c508853e37/data?f=pjson for reference.

I admit its a rather vague question but I can't really formulate it better.

Best Answer

The data is actually in there. I have extracted point data before by copying the file into Notepad++ and just doing some search and replace. With lines and polygons, your best bet is going to be to do some python scripting using json.load.

Basically, you will use urllib2.urlopen() to connect to your items page and read down the json as text.

Load your json text into a python object using json.loads(). Using the properties of your new object, you should be able to use arcpy to construct your features and then push them out to whatever Esri format you might like.

This actually seems like a worthwhile python utility; maybe someone has made it already? I'll see if I can put together time to create it, as I have use for it too. If you do any work on it, please post your code back up here?