diff --git a/bindings/kepler.gl-jupyter/keplergl/keplergl.py b/bindings/kepler.gl-jupyter/keplergl/keplergl.py index be2f8a26db..1cc347c43b 100644 --- a/bindings/kepler.gl-jupyter/keplergl/keplergl.py +++ b/bindings/kepler.gl-jupyter/keplergl/keplergl.py @@ -3,7 +3,6 @@ from traitlets import Unicode, Dict, Int, validate, TraitError import pandas as pd import geopandas -import shapely.wkt import json from ._version import EXTENSION_SPEC_VERSION import sys @@ -34,14 +33,9 @@ def _gdf_to_dict(gdf): if gdf.crs and not gdf.crs == 4326: gdf = gdf.to_crs(4326) - # get name of the geometry column - # will cause error if data frame has no geometry column - name = gdf.geometry.name # convert geodataframe to dataframe - df = pd.DataFrame(gdf) - # convert geometry to wkt - df[name] = df.geometry.apply(lambda x: shapely.wkt.dumps(x)) + df = pd.DataFrame(gdf.to_wkt()) return _df_to_dict(df) diff --git a/bindings/kepler.gl-jupyter/requirements.txt b/bindings/kepler.gl-jupyter/requirements.txt index b78c442991..057a06ca3a 100644 --- a/bindings/kepler.gl-jupyter/requirements.txt +++ b/bindings/kepler.gl-jupyter/requirements.txt @@ -1,6 +1,5 @@ -geopandas==0.5.0 +geopandas==0.9.0 ipywidgets==7.4.2 pandas==0.24.2 -Shapely==1.6.4.post2 traitlets==4.3.2 traittypes==0.2.1