0

I would like to use the ArcGIS REST elevation service.

Providing a list of locations I would like to receive a list of elevations relative to these locations.

After some struggling with the syntax I was able to create a working (synchronous) request:

https://elevation.arcgis.com/arcgis/rest/services/Tools/ElevationSync/GPServer/Profile/execute?InputLineFeatures={  
   "displayFieldName":"",
   "geometryType":"esriGeometryPolyline",
   "spatialReference":{  
      "wkid":4326
   },
   "fields":[  
      {  
         "name":"OID",
         "type":"esriFieldTypeOID",
         "alias":"OID"
      },
      {  
         "name":"Shape_Length",
         "type":"esriFieldTypeDouble",
         "alias":"Shape_Length"
      }
   ],
    "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "MultiPoint",
        "coordinates": [
          [
            52.50,
            13.30
          ],
          [
            52.60,
            13.40
          ],
          [
            52.70,
            13.50
          ],
          [
            52.80,
            13.60
          ]
        ]
      }
    }
  ],
   "exceededTransferLimit":false
}&ProfileIDField=&DEMResolution=&MaximumSampleDistance=&MaximumSampleDistanceUnits=&env:outSR=&env:processSR=&returnZ=true&returnM=true&f=json

But unfortunately the response result is empty

{  
   "results":[  
      {  
         "paramName":"OutputProfile",
         "dataType":"GPFeatureRecordSetLayer",
         "value":{  

         }
      }
   ],
   "messages":[  

   ]
}

What am I doing wrong?

0

Try

http://elevation.arcgis.com/arcgis/rest/services/Tools/ElevationSync/GPServer/Profile/execute?InputLineFeatures=%7B%22geometryType%22%3A%22esriGeometryPolyline%22%2C%22features%22%3A%5B%7B%22geometry%22%3A%7B%22paths%22%3A%5B%5B%5B52.50%2C13.30%5D%2C%5B52.60%2C13.40%5D%2C%5B52.70%2C13.50%5D%2C%5B52.80%2C13.60%5D%5D%5D%2C%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%7D%7D%5D%7D&ProfileIDField=OID&DEMResolution=FINEST&MaximumSampleDistance=50000&MaximumSampleDistanceUnits=&env%3AoutSR=4326&env%3AprocessSR=4326&returnZ=true&returnM=true&f=html

Gives you a result of (HTML):

    {
 "results": [{
  "paramName": "OutputProfile",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
   "displayFieldName": "",
   "hasZ": true,
   "hasM": true,
   "geometryType": "esriGeometryPolyline",
   "spatialReference": {
    "wkid": 4326,
    "latestWkid": 4326
   },
   "fields": [
    {
     "name": "OBJECTID",
     "type": "esriFieldTypeOID",
     "alias": "OBJECTID"
    },
    {
     "name": "DEMResolution",
     "type": "esriFieldTypeString",
     "alias": "DEM Resolution",
     "length": 50
    },
    {
     "name": "ProductName",
     "type": "esriFieldTypeString",
     "alias": "Product Name",
     "length": 50
    },
    {
     "name": "Source",
     "type": "esriFieldTypeString",
     "alias": "Source",
     "length": 50
    },
    {
     "name": "Source_URL",
     "type": "esriFieldTypeString",
     "alias": "Source URL",
     "length": 84
    },
    {
     "name": "ProfileLength",
     "type": "esriFieldTypeDouble",
     "alias": "Length Meters"
    },
    {
     "name": "Shape_Length",
     "type": "esriFieldTypeDouble",
     "alias": "Shape_Length"
    }
   ],
   "features": [{
    "attributes": {
     "OBJECTID": 1,
     "DEMResolution": "1000m",
     "ProductName": "GEBCO_14",
     "Source": "BODC",
     "Source_URL": "https://www.bodc.ac.uk/data/online_delivery/gebco/",
     "ProfileLength": 46442.6656443336,
     "Shape_Length": 0.42426406878891676
    },
    "geometry": {
     "hasZ": true,
     "hasM": true,
     "paths": [[
      [
       52.500000000276486,
       13.300000000357443,
       -2205.644499999995,
       0
      ],
      [
       52.60000000029464,
       13.400000000375599,
       -2425.592399999994,
       15480.888500000001
      ],
      [
       52.7000000003128,
       13.500000000393754,
       -2572.166100000002,
       30961.777100000007
      ],
      [
       52.8000000003309,
       13.60000000041191,
       -2569.067200000005,
       46442.66560000001
      ]
     ]]
    }
   }],
   "exceededTransferLimit": false
  }
 }],
 "messages": []
}

This source was used and replaced with your coordinates https://jsfiddle.net/6zc07mr9/9/

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.