0

I am pulling data from Wayback Imagery and attempting to export an image after making it into a arcgis.mapping.MapImageLayer. When I run my code the image it produces is blank and I'm unsure why. The bounding box should be plenty large enough to see something.

import arcgis
import re
from arcgis.gis import GIS
from arcgis.mapping import WebMap
from IPython.display import display

gis = GIS("https://www.arcgis.com", "arcgis_python", "P@ssword123", verify_cert=False)
result = gis.content.search(query="title:Wayback",sort_field="numViews",
                            outside_org=True,max_items=1,item_type = "Map Service")
ids = '903f0abe9c3b452dafe1ca5b8dd858b9'

bbox=bbox=-141.19530416221985,-62.217823180545146,139.27427961579508,84.15317625109763
size = 600,550
format = "png"

print(len(result))
count=0
for item in result:
    print(item)
    map = gis.content.get(item.id)

    if(re.match(r'(World Imagery \(Wayback ).*',map.title)):
        print(map.title)
        print(type(map))
        print(map)
        display(map)
        wm = WebMap()
        wm.add_layer(map)
        print(wm.layers[0]['title'])
        print(wm.layers[0]['url'])
        mapImage = arcgis.mapping.MapImageLayer('https://metadata.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Metadata_2014_r01/MapServer')
        returnJson = mapImage.export_map(bbox,image_format='html')
        print(returnJson)
        count+=1                
    else:
        #will do more stuff later
        pass

Below is the output I am receiving:

<Item title:"World Imagery (Wayback 2014-02-20) Metadata" type:Map Image Layer owner:esri_imagery>
World Imagery (Wayback 2014-02-20) Metadata
<class 'arcgis.gis.Item'>
<Item title:"World Imagery (Wayback 2014-02-20) Metadata" type:Map Image Layer owner:esri_imagery>

World Imagery (Wayback 2014-02-20) Metadata
This World Imagery Metadata layer provides detailed information for each image source in World Imagery (Wayback 2014-02-20).Map Image Layer by esri_imagery
Last Modified: December 11, 2019
0 comments, 59,777 views
1.9cm Resolution Metadata
https://metadata.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Metadata_2014_r01/MapServer/0
{'href': 'https://metadata.maptiles.arcgis.com/arcgis/rest/directories/arcgisoutput/World_Imagery_Metadata_2014_r01_MapServer/_ags_mapc034e8d33e09406d9405e44efe3de69c.png', 'width': 600, 'height': 550, 'extent': {'xmin': -36067515.01650002, 'ymin': -17088899.391186584, 'xmax': -5180428.986109771, 'ymax': 11224262.803337809, 'spatialReference': {'wkid': 102100, 'latestWkid': 3857}}, 'scale': 405341525.67215466}

I take the https//* and paste it into Google and get a blank image.

Your Answer

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

Browse other questions tagged or ask your own question.