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

Add DataAPI metadata passthrough to apply #211

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Add DataAPI metadata passthrough to apply #211

merged 3 commits into from
Sep 19, 2024

Conversation

asinghvi17
Copy link
Member

This PR propagates all non-:default style metadata through to the result table in apply on tables, if:

  • there is metadata that can be read in the input table
  • the result table type supports metadata writes (so not a named tuple table, for example)

This PR also adds GEOINTERFACE:geometrycolumns and GEOINTERFACE:crs tags to the resulting table, and ensures that the CRS is correct according to:
a. the crs kwarg to apply
if that is not present,
b. GI.crs(input_table)

this way, GO.reproject automatically changes the table metadata too!

@asinghvi17 asinghvi17 self-assigned this Sep 19, 2024
@asinghvi17 asinghvi17 added enhancement New feature or request geocompjl Methods needed for geocompjl labels Sep 19, 2024
@asinghvi17
Copy link
Member Author

asinghvi17 commented Sep 19, 2024

I should probably PR this idea to GeoInterface too, preferably that gets merged before we merge this.

Nevermind, I already implemented this in https://github.com/evetion/GeoDataFrames/pull/70 so it just works!

@asinghvi17 asinghvi17 changed the title Add DataAPI metadata passthrough Add DataAPI metadata passthrough to apply Sep 19, 2024
Copy link
Member

@rafaqz rafaqz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

It could be nice to put this metadata update function in GeoInterface.jl some day, so we use the same thing everywhere. But here is fine for now.

@asinghvi17
Copy link
Member Author

Agreed, will look at a GeoInterface PR to encode this standard tomorrow. Then we can go about defining metadata for e.g. GeoJSON, Shapefile, etc so everything just flows.

@asinghvi17 asinghvi17 merged commit 7675b03 into main Sep 19, 2024
6 checks passed
@asinghvi17 asinghvi17 deleted the as/dataapi branch September 19, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request geocompjl Methods needed for geocompjl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants