Skip to main content

I just want to use Planet tiles as a basemap for a Jupyter Notebook application, using ipyleaflet widget.

In my environment, I imported these packages:

import geopandas as gpd
import seaborn as sb
from ipyleaflet import Map, basemaps, basemap_to_tiles, TileLayer
from shapely.geometry import Point
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import gdal
from gdalconst import GA_ReadOnly
from os.path import realpath
import os

nb.: There are a lot of packages beacause in the NB I do other processing of raster and vector data.

Now, I am trying to initialize a map and streaming Planet tiles using my API.

planet_tiles_url=("https://tiles{0}.planet.com/basemaps/v1/planet-tiles/global_monthly_2016_05_mosaic/gmap/{x}/{y}/{z}.png?api_key=abc123")
tile_layer=TileLayer(url=planet_tiles_url)

m = Map(
    default_tiles=tile_layer,
    center=center,
    zoom=14,
    scroll_wheel_zoom=True)

m.add_layer(tile_layer)
m.add_control(LayersControl())
m

No error pops up. But no Planet basemap is displayed and not even the layer controls. See image..

enter image description here

What am I doing wrong?

I just want to use Planet tiles as a basemap for a Jupyter Notebook application, using ipyleaflet widget.

In my environment, I imported these packages:

import geopandas as gpd
import seaborn as sb
from ipyleaflet import Map, basemaps, basemap_to_tiles, TileLayer
from shapely.geometry import Point
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import gdal
from gdalconst import GA_ReadOnly
from os.path import realpath
import os

nb.: There are a lot of packages beacause in the NB I do other processing of raster and vector data.

Now, I am trying to initialize a map and streaming Planet tiles using my API.

planet_tiles_url=("https://tiles{0}.planet.com/basemaps/v1/planet-tiles/global_monthly_2016_05_mosaic/gmap/{x}/{y}/{z}.png?api_key=abc123")
tile_layer=TileLayer(url=planet_tiles_url)

m = Map(
    default_tiles=tile_layer,
    center=center,
    zoom=14,
    scroll_wheel_zoom=True)

m.add_layer(tile_layer)
m.add_control(LayersControl())
m

No error pops up. But no Planet basemap is displayed and not even the layer controls. See image..

enter image description here

What am I doing wrong?

I just want to use Planet tiles as a basemap for a Jupyter Notebook application, using ipyleaflet widget.

In my environment, I imported these packages:

from ipyleaflet import Map, basemaps, basemap_to_tiles, TileLayer

Now, I am trying to initialize a map and streaming Planet tiles using my API.

planet_tiles_url=("https://tiles{0}.planet.com/basemaps/v1/planet-tiles/global_monthly_2016_05_mosaic/gmap/{x}/{y}/{z}.png?api_key=abc123")
tile_layer=TileLayer(url=planet_tiles_url)

m = Map(
    default_tiles=tile_layer,
    center=center,
    zoom=14,
    scroll_wheel_zoom=True)

m.add_layer(tile_layer)
m.add_control(LayersControl())
m

No error pops up. But no Planet basemap is displayed and not even the layer controls. See image..

enter image description here

What am I doing wrong?

edited title
Link
Nick Pucino
  • 190
  • 1
  • 1
  • 12

Streaming How to use Planet Lab tiles in Jupyter Notebook with ipyleaflet for web map displaying?

edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Issue with streaming Streaming Planet Lab tiles in Jupyter Notebook with ipyleaflet for web map displaying?

Source Link
Nick Pucino
  • 190
  • 1
  • 1
  • 12
Loading