This is a quick post updating the last one. Some people inquired me on the possibility of downloading a georeferenced image from an online service.
The answer is yes and no. Cartopy has some very handy functions to do just that. However, most of them will not have the desired zoom level for just a small area as the one in the previous post. Also, the Itaguaré region is very dynamic, so it is hard to find one image that will represent the area for all times. (Recall that in my previous post I rolled back the Google Earth Image archive to find one that was similar to the day of the sampling).
Anyways, if you are not limited by those points I raised above go ahead and give it a try!
import matplotlib.pyplot as plt
import cartopy.io.img_tiles as cimgt
def map_quest(map_request, figsize=(8, 8),
llcrnrlon=None, urcrnrlon=None,
llcrnrlat=None, urcrnrlat=None, zoom=8):
# Create a GeoAxes in the tile's projection.
fig, ax = plt.subplots(figsize=figsize, subplot_kw=dict(projection=map_request.crs))
ax.set_extent([llcrnrlon, urcrnrlon, llcrnrlat, urcrnrlat])
ax.add_image(map_request, zoom)
return fig, ax
llcrnrlon = -(45 + (58 + 32.27/60) / 60) # 45°58'32.27"W
urcrnrlon = -(45 + (57 + 54.54/60) / 60) # 45°57'54.54"W
llcrnrlat = -(23 + (47 + 7.65/60) / 60) # 23°47' 7.65"S
urcrnrlat = -(23 + (46 + 42.25/60) / 60) # 23°46'42.25"S
The Map Quest Aerial is a good choice if you are in the USA, but global coverage is provided only at zoom levels 0--11:
map_request = cimgt.MapQuestOpenAerial()
fig, ax = map_quest(map_request,
llcrnrlon=llcrnrlon, urcrnrlon=urcrnrlon,
llcrnrlat=llcrnrlat, urcrnrlat=urcrnrlat,
zoom=11)
Open Street Map:
map_request = cimgt.OSM()
fig, ax = map_quest(map_request,
llcrnrlon=llcrnrlon, urcrnrlon=urcrnrlon,
llcrnrlat=llcrnrlat, urcrnrlat=urcrnrlat,
zoom=15)
Google WTS:
map_request = cimgt.GoogleTiles()
fig, ax = map_quest(map_request,
llcrnrlon=llcrnrlon, urcrnrlon=urcrnrlon,
llcrnrlat=llcrnrlat, urcrnrlat=urcrnrlat,
zoom=15)
Map Quest using Open Street Maps:
map_request = cimgt.MapQuestOSM()
fig, ax = map_quest(map_request,
llcrnrlon=llcrnrlon, urcrnrlon=urcrnrlon,
llcrnrlat=llcrnrlat, urcrnrlat=urcrnrlat,
zoom=15)
Microsoft WTS:
map_request = cimgt.QuadtreeTiles()
fig, ax = map_quest(map_request,
llcrnrlon=llcrnrlon, urcrnrlon=urcrnrlon,
llcrnrlat=llcrnrlat, urcrnrlat=urcrnrlat,
zoom=15)
This last one was almost OK, but the image quality is not as Google Earth's image.
HTML(html)