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

[WIP] Add a Tables.jl extension for FeatureCollection and Feature

Open asinghvi17 opened this issue 1 year ago • 2 comments

This PR treats FeatureCollections as row tables, and Features as rows.

julia> @time DataFrame(fc2)
  6.790032 seconds (10.19 M allocations: 3.447 GiB, 1.13% gc time)
177×169 DataFrame
 Row │ geometry                           FCLASS_IL        CONTINENT      NAME_FA              WB_A3   ADM0_A3_WB  FCLASS_SE        NAME_RU                ⋯
     │ WrapperG…                          Union…           String         String               String  Int64       Union…           String                 ⋯
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ MultiPolygon{false, false, Vecto…                   Oceania        فیجی                 FJI            -99                   Фиджи                  ⋯
   2 │ Polygon{false, false, Vector{Lin…                   Africa         تانزانیا             TZA            -99                   Танзания
   3 │ Polygon{false, false, Vector{Lin…                   Africa         صحرای غربی           -99            -99                   Западная Сахара
   4 │ MultiPolygon{false, false, Vecto…                   North America  کانادا               CAN            -99                   Канада
   5 │ MultiPolygon{false, false, Vecto…                   North America  ایالات متحده آمریکا  USA            -99                   США                    ⋯
  ⋮  │                 ⋮                         ⋮               ⋮                 ⋮             ⋮         ⋮              ⋮                  ⋮             ⋱
 173 │ Polygon{false, false, Vector{Lin…                   Europe         صربستان              SRB            -99                   Сербия
 174 │ Polygon{false, false, Vector{Lin…                   Europe         مونتهنگرو            MNE            -99                   Черногория
 175 │ Polygon{false, false, Vector{Lin…  Admin-0 country  Europe         کوزووو               KSV            -99  Admin-0 country  Республика Косово
 176 │ Polygon{false, false, Vector{Lin…                   North America  ترینیداد و توباگو    TTO            -99                   Тринидад и Тобаго      ⋯
 177 │ Polygon{false, false, Vector{Lin…  

so it's not great, but we can make it work. I'm still not sure how GeoJSON gets it so fast.

asinghvi17 avatar Sep 20 '24 01:09 asinghvi17

Lots of licked cooky PRs here unfinished ;)

Would be good to get all of these in

rafaqz avatar Nov 08 '25 06:11 rafaqz

I remember that this PR broke something just don't remember what.

A nice side effect of this is that AoG will just work on any feature collection

asinghvi17 avatar Nov 08 '25 12:11 asinghvi17