Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geoda.cars geometry column not automatic #16

Open
kylebarron opened this issue Oct 27, 2023 · 1 comment
Open

geoda.cars geometry column not automatic #16

kylebarron opened this issue Oct 27, 2023 · 1 comment

Comments

@kylebarron
Copy link

kylebarron commented Oct 27, 2023

Unclear if you consider this an issue or not, but it would be nice if gpd.read_file(geodatasets.get_path()) always constructed a dataframe with a geometry column. For the geoda.cars dataset, the geometry column is full of None values, but there are lat/lon columns:

gdf = gpd.read_file(geodatasets.get_path("geoda.cars"))
image

Is the right solution:

  • Fix this under the hood somehow
  • Tell the user to construct a geometry column from the lat/lon columns after loading
  • Inform the user about the underlying CSV structure to pass the right OGR open options
@martinfleis
Copy link
Member

The empty geometry column seems to be issue only for Fiona engine. Reading it with engine="pyogrio" (the new default in the geopandas 1.0), it is not there, but you also get a pandas.DataFrame (that is a bit of inconsistency we need to resolve somehow).

About the solutions, I am not sure what to do.

geodatasets is just giving you an unaltered file and I believe it should stay that way.

The rest is related to a better documentation on a dataset level, which I am not sure how would I do. Maybe via a note in the dataset json?

There is also another option and that is a removal of the dataset if we think that gpd.read_file(geodatasets.get_path("name")) should always result in a GeoDataFrame in an expected form.

Since the goal of geodatasets is to provide mostly educational and illustrational data, having a CSV with point coordinates feels useful but there was never a deep discussion on the scope, so happy to hear your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants