ArchGDAL.jl icon indicating copy to clipboard operation
ArchGDAL.jl copied to clipboard

Construct ArchGDAL. IFeatureLayer via named tuples or DataFrame

Open zerefwayne opened this issue 5 years ago • 5 comments

I have a use case of filtering rows out of an ArchGDAL table and then return ArchGDAL.Table datatype. It would be helpful to construct an ArchGDAL.Table using an array of named tuples or even a DataFrame from DataFrames.jl.

https://github.com/yeesian/ArchGDAL.jl/blob/0bdcb008741fa1c9d09c119eca8a800aa6a2654e/src/tables.jl#L7-L9

cc: @juliohm @visr

zerefwayne avatar Nov 09 '20 12:11 zerefwayne

@zerefwayne I suggest starting a draft PR in GADM.jl and linking to this issue. It is hard to know exactly what you are trying to achieve otherwise. :+1:

juliohm avatar Nov 09 '20 13:11 juliohm

We currently support https://tables.juliadata.org/stable/#Implementing-the-Interface-(i.e.-becoming-a-Tables.jl-source)-1 in src/tables.jl.

It will be nice to support the creation of an ArchGDAL.Dataset (or FeatureLayer) from a corresponding table via https://tables.juliadata.org/stable/#Using-the-Interface-(i.e.-consuming-Tables.jl-compatible-sources)-1: here's an example of how it can be done. Here's a second example: https://discourse.julialang.org/t/how-to-create-a-new-shapefile-containing-a-few-points.

yeesian avatar Nov 15 '20 22:11 yeesian

Shameless plug (I'm the author), I've made a first implementation over at https://github.com/evetion/GeoDataFrames.jl.

evetion avatar Dec 30 '20 18:12 evetion

@yeesian (cc: @evetion) I'm could work on this by creating IFeatureLayer constructor for table types (creating an associated a "Memory" driver Dataset).

Writing to a file, could then be handled by a write, leaving GDAL handling the driver restrictions as pointed in https://github.com/yeesian/ArchGDAL.jl/issues/147#issuecomment-714186909

mathieu17g avatar Sep 03 '21 10:09 mathieu17g

That'll be really awesome @mathieu17g! I also agree that the analogous GDAL object is a feature layer and have updated the title to reflect it.

Somewhat related: #153

yeesian avatar Sep 03 '21 23:09 yeesian