Skip to content

Mapillary

image image image

Visualizing Mapillary Vector Tiles

Mapillary provides a global dataset of street-level images, with coverage in many countries. The Mapillary vector tiles provide a way to access the data in a vector format, which can be used to create custom maps and visualizations.

Uncomment the following line to install leafmap if needed.

1
# %pip install "leafmap[maplibre]"
1
2
import leafmap.common as common
import leafmap.maplibregl as leafmap

To run this notebook, you will need an access token from Mapillary. Once you have the API key, you can uncomment the following code block and replace YOUR_API_KEY with your actual API key. Then, run the code block code to set the API key as an environment variable.

1
2
# import os
# os.environ["MAPILLARY_API_KEY"] = "YOUR_API_KEY"
1
2
3
4
5
6
7
m = leafmap.Map(
    style="bright", center=[-73.99941, 40.71194], zoom=13, sidebar_visible=True
)
m.add_basemap("Satellite")
m.add_mapillary(minzoom=6, maxzoom=14, add_popup=True, add_to_sidebar=True)
m.add_layer_control()
m

image

1
2
3
4
image_ids = common.search_mapillary_images(
    lon=-73.99941, lat=40.71194, radius=0.0005, limit=5
)
image_ids
1
common.get_mapillary_image_url(image_ids[0], resolution="original")
1
common.download_mapillary_images(image_ids, resolution="original")
1
common.get_mapillary_image_widget(image_ids[0], style="classic", width=1000)
1
common.get_mapillary_image_widget(image_ids[0], style="split", width=1000)
1
common.get_mapillary_image_widget(image_ids[0], style="photo", width=1000)
1
2
3
4
5
6
m = leafmap.Map(style="bright", center=[-73.99941, 40.71194], zoom=13)
m.add_basemap("Satellite")
m.add_mapillary(minzoom=6, maxzoom=14, add_popup=True)
m.add_layer_control()
widget = m.create_mapillary_widget(style="photo", width=500)
widget

image