Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
feat: add cam locations
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-milan committed Nov 13, 2023
1 parent 05d6160 commit 549ad39
Show file tree
Hide file tree
Showing 2 changed files with 3,495 additions and 20 deletions.
38 changes: 18 additions & 20 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
import streamlit as st
import pandas as pd
from pathlib import Path

import numpy as np
import pandas as pd
import pydeck as pdk
import streamlit as st

chart_data = pd.DataFrame(
np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4], columns=["lat", "lon"]
)
tmp_data_path = Path(__file__).parent.parent / "data" / "cameras_h3_1.csv"
chart_data = pd.read_csv(tmp_data_path)

st.pydeck_chart(
pdk.Deck(
map_style=None,
initial_view_state=pdk.ViewState(
latitude=37.76,
longitude=-122.4,
zoom=11,
pitch=50,
latitude=-22.93,
longitude=-43.41,
zoom=9,
pitch=0,
),
layers=[
pdk.Layer(
"HexagonLayer",
data=chart_data,
get_position="[lon, lat]",
radius=200,
elevation_scale=4,
elevation_range=[0, 1000],
pickable=True,
extruded=True,
),
pdk.Layer(
"ScatterplotLayer",
data=chart_data,
get_position="[lon, lat]",
get_position="[longitude, latitude]",
get_color="[200, 30, 0, 160]",
get_radius=200,
),
],
tooltip={
"html": "<b>Camera:</b> {nome_da_camera}<br/><b>Status:</b> {status_right}",
"style": {
"backgroundColor": "steelblue",
"color": "white",
},
},
)
)
Loading

0 comments on commit 549ad39

Please sign in to comment.