Closed pmlpm1986 closed 1 year ago
Thanks @pmlpm1986, I noticed this GeoPandas warning recently too and I think we're in the clear and our code is behaving properly for the future. The relevant lines are here. Our code takes a GeoDataFrame that may or may not already have a "geometry" column, adds a null "geometry" column to it if it's lacking one, then sets the geometry. However, the GeoPandas warning states:
Currently, this automatically sets the active geometry column to 'geometry' but in the future that will no longer happen. Instead, either provide geometry to the GeoDataFrame constructor (GeoDataFrame(... geometry=GeoSeries()) or use
set_geometry('geometry')
to explicitly set the active geometry column.
We're already doing the latter---using set_geometry('geometry')
to explicitly set the active geometry column---so I'm not totally clear why the warning is happening anyway. Maybe a GeoPandas expert can confirm if we're handling this properly for future-proofing if they have any time and inclination @martinfleis @jorisvandenbossche.
we're in the clear and our code is behaving properly for the future
I don't think that is correct but not because of the assignment on l.85 but the line 86.
set_geometry
does not work in place by default so the line does nothing. Once the behaviour of default active geometry columns changes, this GeoDataFrame will result in a one with no active geometry.
I will make a PR to fix this.
Completely fill out the following template.
Problem description
I built a package that relies on osmnx (1.4.0) and got the following warning:
I just wanted to signal this.
Environment information
Provide a complete minimal reproducible example