You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like this could use a tighter geopandas integration.
I noticed that this assumes the geometry column is named "geometry" which is not always the case.
You can get the active geometry column name with gdf.geometry.name where gdf.geometry attribute is always the active geometry. This works in geopandas 0.14.2.
I peaked at the source code, it seems like sometimes the gdf.geometry attribute is used in the source, but maybe it just looks for a column named "geometry" because it assumes it's a pandas dataframe. I'm not sure
Reproduction steps
I noticed this when running code something like this:
gdf=gdf.set_geometry("points_geometry") # The only geometry column, contains several pointsh3.geo_to_h3_aggregate(7, return_geometry=True)
I got this error:
TypeError: 'GeometryArray' with dtype geometry does not support reduction 'sum'
The above exception was the direct cause of the following exception:
TypeError: agg function failed [how->sum,dtype->geometry]
If I rename and drop the original geometry, it works
The text was updated successfully, but these errors were encountered:
rejexx
changed the title
geopandas integration, add arbitrary geometry column name
geopandas integration, support arbitrary geometry column name
Feb 9, 2024
Awesome project, makes life much easier.
It seems like this could use a tighter geopandas integration.
I noticed that this assumes the geometry column is named "geometry" which is not always the case.
You can get the active geometry column name with
gdf.geometry.name
wheregdf.geometry
attribute is always the active geometry. This works in geopandas 0.14.2.I peaked at the source code, it seems like sometimes the gdf.geometry attribute is used in the source, but maybe it just looks for a column named "geometry" because it assumes it's a pandas dataframe. I'm not sure
Reproduction steps
I noticed this when running code something like this:
I got this error:
If I rename and drop the original geometry, it works
The text was updated successfully, but these errors were encountered: