$ pip install jupyterlab
$ jupyter labextension install @jupyterlab/geojson-extension
Created
January 25, 2018 05:35
-
-
Save jqtrde/daef70d6aab17d3e32b21ae96a7dcd73 to your computer and use it in GitHub Desktop.
A nice little geojson renderer for Jupyter Lab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import GeoJSON | |
import json | |
import os | |
URL_TEMPLATE = "https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=TOKEN".replace('TOKEN', os.environ.get('MapboxAccessToken')) | |
with open("wichita.geojson") as geoj: | |
data = json.load(geoj) | |
GeoJSON( | |
data=data, | |
url_template=URL_TEMPLATE, | |
layer_options={ | |
"id": "mapbox.satellite" | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment