I have a set of points I would like to retrieve the slope or aspect from within a Jupyter notebook. I am using an enterprise geoportal server, and when I view the (Esri Living Atlas) Aspect or Slope image layers, I can easily see values for any point I click on.
How I can do this from Python?
What I would typically do for similar layers (with a single example point) is something like this:
item_id = "63fe6ad86c3d4536a3c44a0fbad0045e" #item id for aspect layer from Living Atlas
aspect = GIS.content.get(item_id)
pnt = {'x': -120.01072748799995,
'y': 38.85096736000008,
'spatialReference': {'wkid': 4326, 'latestWkid': 4326}}
aspect.layers[0].get_samples(geometry=pnt)
But all I am getting is the elevation! My result for the above code is:
[{'location': {'x': -120.01072748799994,
'y': 38.85096736000008,
'spatialReference': {'wkid': 4326, 'latestWkid': 4326}},
'locationId': 0,
'value': '1970.710205078',
'rasterId': 3740,
'resolution': 3.086419871794868e-05,
'values': [1970.710205078]}]
What I would like to get is the aspect (and slope) similar to the result in the webmap image below.
Note: I am using ArcGIS version 1.6.2