-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Kuethe
committed
Jul 25, 2024
1 parent
0fa4e7d
commit 9200b04
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import json | ||
|
||
import pandas as pd | ||
from maplibre import Map, MapOptions | ||
from pydeck import Layer as PyDeckLayer | ||
|
||
UK_ACCIDENTS_DATA = ( | ||
"https://raw.githubusercontent.com/uber-common/" | ||
"deck.gl-data/master/examples/3d-heatmap/heatmap-data.csv" | ||
) | ||
|
||
df = pd.read_csv(UK_ACCIDENTS_DATA) | ||
|
||
layer = PyDeckLayer( | ||
"HexagonLayer", | ||
df, | ||
# UK_ACCIDENTS_DATA, | ||
get_position=["lng", "lat"], | ||
auto_highlight=True, | ||
elevation_scale=50, | ||
pickable=True, | ||
elevation_range=[0, 3000], | ||
extruded=True, | ||
coverage=1, | ||
) | ||
|
||
m = Map(MapOptions(center=(1.415, 52.2323), zoom=6)) | ||
m.add_deck_layers([json.loads(layer.to_json())]) | ||
m.save("/tmp/py-maplibre-express.html") |