Skip to content

Instantly share code, notes, and snippets.

@do-me
Created May 29, 2024 15:11
Show Gist options
  • Save do-me/e362313b3f61c209faf7a0a323cbef02 to your computer and use it in GitHub Desktop.
Save do-me/e362313b3f61c209faf7a0a323cbef02 to your computer and use it in GitHub Desktop.
Plot 52Mio Overture Maps places with datashader in Python
import geopandas as gpd
import datashader as ds
from colorcet import fire
# download the data before with:
# overturemaps download -f geoparquet --type=place -o places.parquet
gdf = gpd.read_parquet("places.parquet") # takes 3 mins on my M3
# plotting takes 1 min
cvs = ds.Canvas(plot_width=2000, plot_height=1000)
agg = cvs.points(gdf, geometry='geometry')
img = ds.tf.shade(agg, cmap=fire, how='log')
# display the image in Jupyter
img
# see the plot here:
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment