I would like to extract the "Existing KinderMorgan Trans Mtn Tar Sands Pipeline" from this ArcGIS REST service and convert it to GeoJSON.

Ogrinfo can't read the JSON (it's not standard ESRI JSON):

ogrinfo -ro -al "https://www.arcgis.com/sharing/rest/content/items/7f1b75176ff04835babaea9e8bf089be/data?f=json&token=v_mw6QmUA-8L1xn7RoZXXBUy93tLgZKbEjpN24a_ZsM33Nnzvz0BqRlib0b3i-hVp1E2-7bPfXazS-mmUuLshS8y4jL7KVJ9pIgUO03eGo2AzoZidT6c1rPtVf2W4lrcw-504JcFq-wi4Q8zYty8lMtD3I6MfwmUsvuC_A_k3AhfRyTUcok7sKg9eQWkG0-5"

But I was able to locate the geometry of my desired layer inside the document: https://pastebin.com/kCkY9pyt

Here is a shortened version:

                "features": [
                        "paths": [
                                [-1.36867702E7, 6324333.3],
                                [-12619696, 7083560.4]
                            "wkid": 102100,
                            "latestWkid": 3857
                        "FID": 0,
                        "Name": " ",
                        "Shape_Leng": 1148418.1022,
                        "Shape_Le_1": 1148418.1022
                "geometryType": "esriGeometryPolyline"

How can I feed this JSON into arcgis-to-geojson-utilities? Or can I use any other tool to convert it?

  • 1
    The URL you're referencing, while it may have "Data", is the arcgis.com item. Why didn't you use the FeatureService URL that was provided in the answers to your previous question on this? The feature service supports geojson as output. – KHibma Sep 28 '18 at 19:46
  • 1
    Oh - I understand now. This is an entirely different pipeline and dataset. You're sifting through arcgis.com maps and services and making local copies of the data... – KHibma Sep 28 '18 at 19:48
  • @KHibma Oh, you are working for ESRI? Wouldn't it be possible for you to quickly locate the raw data of this dataset? If it's not against your employer's will ;) – Luis Paganini Sep 28 '18 at 20:05
  • 1
    No. No it wouldn't be possible. I actually take issue with anyone who thinks just because something is on the internet, that means its there to download and do what you want with. That's my view, not my employers. If you found these through OpenData or other sites that encourage download, I'd fully support that. – KHibma Sep 29 '18 at 1:35
  • 1
    @LuisPaganini Welcome to GIS SE. I deleted your comment as it was inappropriate for this site. We expect that you and everyone else treat others in a courteous manner. – Aaron Sep 29 '18 at 2:57

Querying a layer of a mapservice can be returned as a geoJson. In versions 10.4 and up. In your code you could get a list of layers, and then plug each layer in and 1=1 and return of geoJson and * for output fields and you'll get that layer as a geoJson. Otherwise, there is no way to get an entire ESRI mapservice as a geoJson, but in QGIS you can convert the json to geoJson.

I could not tell from the tokenized url that you shared what GIS server type you are accessing behind the url. If it's ArcGIS Online, there is also a way to get to the mapservices, on the ArcGIS server running the ArcGIS Online instance.

Ex. If you are accessing an ESRI mapservice, for example a service from here: https://www.fws.gov/wetlands/arcgis/rest/services You would do something like the below to return geoJson: https://www.fws.gov/wetlands/arcgis/rest/services/Data_Source/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentsOnly=false&datumTransformation=&parameterValues=&rangeValues=&f=geojson


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.