I have a geodataframe with LINESTRING Z geometries:
TimeUTC | Latitude | Longitude | AGL | geometry | |
---|---|---|---|---|---|
0 | 2021-06-16 00:34:04+00:00 | 42.8354 | -70.9196 | 82.2 | LINESTRING Z (42.83541343273769 -70.91961015378617 82.2, 42.83541343273769 -70.91961015378617 82.2) |
1 | 2021-06-14 13:32:18+00:00 | 42.8467 | -70.8192 | 66.3 | LINESTRING Z (42.84674080836037 -70.81919357049679 66.3, 42.84674080836037 -70.81919357049679 66.3) |
2 | 2021-06-18 23:56:05+00:00 | 43.0788 | -70.7541 | 0.9 | LINESTRING Z (43.07882882269921 -70.75414567194126 0.9, 43.07884601143309 -70.75416286067514 0, 43.07885174101104 -70.75416286067514 0, 43.07884028185512 -70.75415713109717 0, 43.07884601143309 -70.75414567194126 0, 43.07884601143309 -70.75414567194126 0) |
I can plot the component points using pydeck's ScatterplotLayer using the raw (not geo) dataframe but I need to also plot the full, smooth, track.
I've tried this:
layers = [
pdk.Layer(
type = "PathLayer",
data=tracks,
get_path="geometry",
width_scale=20,
width_min_pixels=5,
get_width=5,
get_color=[180, 0, 200, 140],
pickable=True,
),
]
view_state = pdk.ViewState(
latitude=gdf_polygon.centroid.x,
longitude=gdf_polygon.centroid.y,
zoom=6,
min_zoom=5,
max_zoom=15,
pitch=40.5,
bearing=-27.36)
r = pdk.Deck(layers=[layers], initial_view_state=view_state)
return(r)
Which silently fails. Try as I might, I cannot find a way to convert the LINESTRING Z's (and I can do without the Z component if need be) to an object that pydeck will accept.