Colleagues,
I need to access Sentinel-2 Level-2A images from Esri's Living Atlas of The World using ArcPy.
(https://imagem.maps.arcgis.com/home/item.html?id=255af1ceee844d6da8ef8440c8f90d00)
If I cannot access the Living Atlas images, what would be another alternative?
The Sentinel-2 image I access needs to be with a certain objectid, example objectid: 23156221.
What should the code in ArcPy (or Python) look like for me to use Sentinel-2 images?
Thanks!
Diego
Solved! Go to Solution.
I wasn't able to access the layer from arcpy - I'm not sure why. But an alternative is to use the ArcGIS API for python. The code to access your object would look like this ('255af1ceee844d6da8ef8440c8f90d00' is the ArcGIS item ID for the sentinal image layer):
from arcgis.gis import GIS
gis = GIS(url=None, username=<my_id>, password=<my_pw>)
item = gis.content.get('255af1ceee844d6da8ef8440c8f90d00')
record = item.layers[0].query(where="objectid=23156221").to_dict()['features'][0]
print (record)
I wasn't able to access the layer from arcpy - I'm not sure why. But an alternative is to use the ArcGIS API for python. The code to access your object would look like this ('255af1ceee844d6da8ef8440c8f90d00' is the ArcGIS item ID for the sentinal image layer):
from arcgis.gis import GIS
gis = GIS(url=None, username=<my_id>, password=<my_pw>)
item = gis.content.get('255af1ceee844d6da8ef8440c8f90d00')
record = item.layers[0].query(where="objectid=23156221").to_dict()['features'][0]
print (record)
How can I download this service's image using Python?