Giter Site home page Giter Site logo

streamlit-keplergl's Introduction

Hi there πŸ‘‹, I'm Christoph, a geospatial engineer and data scientist. I'm interested in all things πŸ—ΊοΈ Geospatial, πŸ§‘β€πŸ”¬ Data Science, βš™οΈ Machine Learning and 🐍 Python.

Homepage | LinkedIn | Twitter


If you want to support my work:

Buy Me A Coffee

streamlit-keplergl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

streamlit-keplergl's Issues

Keplergl problem in Streamlit

I can't deploy keplergl map in Streamlit when I use geopandas and movingpandas in my dataframe. When I only use original dataframe, with latitude and longitude data, works well, but when I use these libraries to analysis stop points and trajectories, I get an error.

Obs.: I used Jupyter to test and visualize the map, but the app is .py file made in VS Code.

20210727_225154

Interactions - Geocoder not working

When navigating to interaction tab and turning on the geocoder the map disappears from the view.

Screenshot 2022-11-11 at 18 39 48

Any idea what could be the cause and how to fix it?

Object of type Timestamp is not JSON serializable`

    keplergl_static(map)
  File "/opt/anaconda3/lib/python3.8/site-packages/streamlit_keplergl/__init__.py", line 29, in keplergl_static
    html = fig._repr_html_()
  File "/opt/anaconda3/lib/python3.8/site-packages/keplergl/keplergl.py", line 170, in _repr_html_
    keplergl_data = json.dumps({"config": config_to_add, "data": data_to_add, "options": {"readOnly": read_only, "centerMap": center_map}})
  File "/opt/anaconda3/lib/python3.8/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/opt/anaconda3/lib/python3.8/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/opt/anaconda3/lib/python3.8/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/opt/anaconda3/lib/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Timestamp is not JSON serializable```

Here are all of the types in my GeoDataFrame:

```TimeUTC           datetime64[ns]
AeroscopeID               string
DroneType                 string
Callsign                  string
FlightID                  string
Latitude                 float64
Longitude                float64
Altitude                 float64
HomeLongitude            float64
HomeLatitude             float64
PilotLongitude           float64
PilotLatitude            float64
geometry                geometry
dtype: object```

There is no "Timestamp" column.

I tried duplicating TimeUTC and converting it to a string with no luck.

Map won't render with specified configuration

Hi, I am trying to load a GeoJson dataset onto the map and I am able to do so successfully and view in a streamlit dashboard however when I specify a config in the KeplerGl() function call keplergl_static(my_map) nothing renders on the dashboard. I can run the same code in a Jupyter notebook and specify the config and the map renders as expected.

Keplergl creashes when using interaction>Geocoder

When toogleing the geocoder functionality (sidebar, interaction), the kepler-gl window becomes black. Checked in Jupter notebook and this does not happen. Only happens with the geocoder button, the others are fine.

Also couldn't find relevant issue upstream, muste be something streamlit component related.

Originally posted by @lennonzheng in #4 (comment)

Can not add data on the map

Hi!
Using streamlit-keplergl, it works like the demo but when I add new data from a csv file, it does not show on the map.
here is part of the code:

with open(CONFIG, 'r') as stream:
  config = yaml.safe_load(stream)

data = pd.read_csv( 'file.csv')
st.dataframe(data.head())
# Build map finally
map = KeplerGl(height=800, data={NAME: data}, config=config)

note: this works on other environments like google colab and Jupiter.
am I doing sth wrong?

New version did not work for me (windows user), map did not plot the data

Hi there,

Just wanted to give you a heads up in case other people face the same issue. For some reason when I created a new virtual env in Anaconda and streamlit-keplergl was upgraded to the new version 0.2.0 my streamlit app stopped plotting the data altogether, but when reverted to 0.1.0 it started working as per usual. I have no idea why though as I am still pretty new to python/streamlit/kepler.

Cheeers,

Cole

Map does not locate on data

I created a demo app to load a geojson and can display fine, but the map always loads over San Fransisco. I think it may be because the dataframe is not passed using the data attribute? Unsure.

import streamlit as st
from streamlit_keplergl import keplergl_static
from keplergl import KeplerGl
import geopandas as gpd

infile = 'data/my.json'

df = gpd.read_file(infile)
map_1 = KeplerGl(height=800)
map_1.add_data(df, 'data_1')
keplergl_static(map_1)

# Show data table
st.dataframe(df.drop(columns=['geometry']))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.