Download satellite tiles and emulate the view from a camera mounted on a UAV pointing down (nadir). All the images downloaded are cached locally to preserve the remote server (so you don't get banned!).
$ pip install git+https://github.com/ricardodeazambuja/AerialViewGenerator
$ pip install -q xyzservices
and
from aerialviewgenerator import AerialView
basemaps = AerialView.getBasemaps()
# check available free tile servers
print(basemaps.keys())
The available maps vary the zoom levels offered. Examples of tile server URL (you need to fill any fields besides the z
, x
, and y
ones):
basemaps['OpenStreetMap.Mapnik']
:https://tile.openstreetmap.org/{z}/{x}/{y}.png
basemaps['GeoportailFrance.orthos']
:https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET={TileMatrixSet}&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}
basemaps['USGS.USImagery']
:https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}
basemaps['Esri.WorldImagery']
:https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}
Another place to check online is the Leaflet providers preview
Finally, search online and you will find other map tile servers that are available.
Depending on your tile server, certain zoom levels will be available. Usually some non-free providers will offer a maximum of up to 20, but for the free ones the zoom goes up to 19. Below is an example for image from France (the only fields left in the baseurl
were z
, x
, and y
):
from aerialviewgenerator.aerialview import AerialView
baseurl = 'https://wxs.ign.fr/choisirgeoportail/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE=normal&TILEMATRIXSET=PM&FORMAT=image/jpeg&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}'
avg = AerialView(zoom=20, baseurl=baseurl)
altitude = 300
bearing = 0 # world map, not local coordinates
fov = 60
lat, lon = 48.858327718853104, 2.294309636169546
img = avg.getAerialImage(lat, lon, bearing, altitude, fov, output_size=(512,512))
img.show()
The only example available, so far, is this notebook. You can test it directly on google colab:
It uses requests
and Pillow
for the main stuff, and quad_sim_python
for the UAV physics.