Describe the bug
add_data using a GeoDataFrame fails if the geometry column is not called "geometry".
The geometry is often called "geometry" but this is not a given.
Error Message:
AttributeError: 'DataFrame' object has no attribute 'geometry'
with a stack pointing to the file keplergl.py line 44:
df[name] = df.geometry.apply(lambda x: shapely.wkt.dumps(x))
Expected behavior
No error message
Environment (please complete the following information):
Python version: 3.9
keplergl version 0.3.2
Additional context
Can be fixed with 1 key stroke :-)
replace
df[name] = df.geometry.apply(lambda x: shapely.wkt.dumps(x))
by
df[name] = gdf.geometry.apply(lambda x: shapely.wkt.dumps(x))
Describe the bug add_data using a GeoDataFrame fails if the geometry column is not called "geometry". The geometry is often called "geometry" but this is not a given.
To Reproduce Steps to reproduce the behavior:
Error Message:
AttributeError: 'DataFrame' object has no attribute 'geometry'
with a stack pointing to the file keplergl.py line 44:df[name] = df.geometry.apply(lambda x: shapely.wkt.dumps(x))
Expected behavior No error message
Environment (please complete the following information):
Additional context Can be fixed with 1 key stroke :-) replace
df[name] = df.geometry.apply(lambda x: shapely.wkt.dumps(x))
bydf[name] = gdf.geometry.apply(lambda x: shapely.wkt.dumps(x))
I'll submit a pull request :-)