Closed asinghvi17 closed 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.
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...
But not traits.
This implements
GI.crs
andGI.geometrycolumns
for DataFrames and DataFrameRows, as well asGI.getfeature
for DataFrame andGI.geometry
andGI.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
andgeometrycolumns
entries are retained for backwards compatibility.The new metadata entries are
GEOINTERFACE:crs
andGEOINTERFACE: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).