evetion / GeoDataFrames.jl

Simple geographical vector interaction built on top of ArchGDAL
https://www.evetion.nl/GeoDataFrames.jl/dev/
MIT License
68 stars 6 forks source link

Implement all applicable GeoInterface methods for DataFrames #70

Closed asinghvi17 closed 4 months ago

asinghvi17 commented 4 months ago

But not traits.

This implements GI.crs and GI.geometrycolumns for DataFrames and DataFrameRows, as well as GI.getfeature for DataFrame and GI.geometry and GI.properties for DataFrameRows.

It also adds the namespace proposition from GeoInterface, so there are now four metadata entries in any GeoDataFrame by default. These are exact copies of the originals, and the original crs and geometrycolumns entries are retained for backwards compatibility.

The new metadata entries are GEOINTERFACE:crs and GEOINTERFACE:geometrycolumns, which are namespaced metadata according to the Arrow spec.

This does not support other tables at the moment - that's probably a decision best made in GeoInterface, since it would need to take on Tables.jl and DataAPI.jl as direct dependencies (to avoid bringing in Requires on Julia < 1.9).

evetion commented 4 months ago

This seems lovely. Only drawback is that we make this repo the "blessed" geospatial dataframe implementation, since we do some type piracy on DataFrame.

asinghvi17 commented 4 months ago

We could move this to GeoInterface (either by taking DataAPI as a direct dependency, or by a package extension (though that would rule out lower versions of Julia). This would allow generic metadata handling, but the cost is that DataFrames does become slightly "blessed", since a lot of other table formats don't handle metadata that well...