imagerySet = "Aerial"
address = session['address']
zoomLevel = ZOOM
url = f"https://dev.virtualearth.net/REST/v1/Imagery/Map/{imagerySet}/{address}/{zoomLevel}"
params = {
'mapSize': "512,512",
'format': "png",
'mapMetadata': "false",
'key': os.environ.get('BING_MAPS_API'),
'zoomLevel': zoomLevel,
'dcl': "1",
}
response = requests.get(url, params=params)
image = open_image(response)
using the dcl param, I can control "decluttering" the pins. But I need the pin gone because I'm using this for a real time computer vision application, and the pin is confusing the model.
Is there a parameter I can pass to get rid of the pushpin using this format?
Thanks!
You're not using the correct API for getting a map without a pin - the one you have above is specifically to get a map with a pin for a searched location. The API you want is this one: https://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet?mapArea={mapArea}&mapSize={mapSize} See documentation here: https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-a-static-map If all you have is an address as input, you can turn that into a lat/long with the geocoding service. https://learn.microsoft.com/en-us/bingmaps/rest-services/locations/ By the way, you may want to check the terms of use to make sure what you're doing is allowed. Building a derivative product or training ML applications is not normally part of the imagery license.