Skip to content

20 planet imagery

image image image

Adding Planet global monthly and quarterly mosaic

Uncomment the following line to install leafmap if needed.

1
# !pip install leafmap
1
2
import os
import leafmap

First, you need to sign up a Planet account and get an API key. See https://developers.planet.com/quickstart/apis. Uncomment the following line to pass in your API key.

1
# os.environ["PLANET_API_KEY"] = "12345"

Determine the tile format based on the plotting backend being use. It can be either ipyleaflet or folium.

1
2
3
4
tile_format = "ipyleaflet"

if os.environ.get("USE_MKDOCS") is not None:
    tile_format = "folium"

Generate Planet quarterly imagery URLs.

1
# leafmap.planet_quarterly()

Generate Planet monthly imagery URLs.

1
# leafmap.planet_monthly()

Generates Planet bi-annual and monthly imagery URLs.

1
# leafmap.planet_catalog()

Generate Planet quarterly imagery TileLayer.

1
quarterly_tiles = leafmap.planet_quarterly_tiles(tile_format=tile_format)

Generate Planet monthly imagery TileLayer.

1
monthly_tiles = leafmap.planet_monthly_tiles(tile_format=tile_format)

Print out the quarterly tile URLs.

1
2
for tile in quarterly_tiles:
    print(tile)

Print out the monthly tile URLs.

1
2
for tile in monthly_tiles:
    print(tile)

Add a Planet monthly mosaic by specifying year and month.

1
2
3
m = leafmap.Map()
m.add_planet_by_month(year=2020, month=8)
m

Add a Planet quarterly mosaic by specifying year and quarter.

1
2
3
m = leafmap.Map()
m.add_planet_by_quarter(year=2019, quarter=2)
m