-
Notifications
You must be signed in to change notification settings - Fork 14
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
Propagate CRS and geometry column from Shapefile.Table via DataAPI #118
base: main
Are you sure you want to change the base?
Conversation
This test was failing before the writer change and I don't entirely understand why:
https://github.com/JuliaGeo/Shapefile.jl/actions/runs/10305538693/job/28526609515?pr=118#step:5:846 |
Using :note is somewhat better indeed, the :default style for GeoDataFrames is lost as soon as you subset the table, I might change that. Implicitely, stuff that (re)projects should check/set the crs, so either take a DataAPI dep, or add the dep to GeoInterface. Lastly, there's |
end | ||
end | ||
function DataAPI.metadata(t::Table, key::String; style = false) | ||
result = if key == "GEOINTERFACE:geometrycolumns" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if this was a constant in GeoInterface.jl
Like:
GI.geometrycolumns_metadata_key
function DataAPI.metadata(t::Table, key::String; style = false) | ||
result = if key == "GEOINTERFACE:geometrycolumns" | ||
(:geometry,) | ||
elseif key == "GEOINTERFACE:crs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And GI.crs_metadata_key
Or something...
Does what it says on the tin, and tests that
DataFrame(table)
retains these values.We currently use the
:note
style meaning that the value of the metadata is propagated through any transformation of the table. This is up for discussion (for reference, GeoDataFrames.jl uses:default
styling, which is invalidated if the dataframe is transformed.).The only operations I can see might have a problem with this are: