Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix schema inference for default method (#33)
Closes #32. Good catch! ``` r library(geoarrow) library(sf) #> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE sf_obj <- data.frame(x = 1:5, y = 6:10) |> sf::st_as_sf(coords = c("x", "y"), crs = "EPSG:3857") # Now works as_geoarrow_array(sf_obj) #> <nanoarrow_array geoarrow.point{struct}[5]> #> $ length : int 5 #> $ null_count: int 0 #> $ offset : int 0 #> $ buffers :List of 1 #> ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> `` #> $ children :List of 2 #> ..$ x:<nanoarrow_array double[5]> #> .. ..$ length : int 5 #> .. ..$ null_count: int 0 #> .. ..$ offset : int 0 #> .. ..$ buffers :List of 2 #> .. .. ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> `` #> .. .. ..$ :<nanoarrow_buffer data<double>[5][40 b]> `1 2 3 4 5` #> .. ..$ dictionary: NULL #> .. ..$ children : list() #> ..$ y:<nanoarrow_array double[5]> #> .. ..$ length : int 5 #> .. ..$ null_count: int 0 #> .. ..$ offset : int 0 #> .. ..$ buffers :List of 2 #> .. .. ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> `` #> .. .. ..$ :<nanoarrow_buffer data<double>[5][40 b]> `6 7 8 9 10` #> .. ..$ dictionary: NULL #> .. ..$ children : list() #> $ dictionary: NULL # Also works...slightly differently (also gives attributes) nanoarrow::as_nanoarrow_array(sf_obj) #> <nanoarrow_array struct[5]> #> $ length : int 5 #> $ null_count: int 0 #> $ offset : int 0 #> $ buffers :List of 1 #> ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> `` #> $ children :List of 1 #> ..$ geometry:<nanoarrow_array geoarrow.point{struct}[5]> #> .. ..$ length : int 5 #> .. ..$ null_count: int 0 #> .. ..$ offset : int 0 #> .. ..$ buffers :List of 1 #> .. .. ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> `` #> .. ..$ children :List of 2 #> .. .. ..$ x:<nanoarrow_array double[5]> #> .. .. .. ..$ length : int 5 #> .. .. .. ..$ null_count: int 0 #> .. .. .. ..$ offset : int 0 #> .. .. .. ..$ buffers :List of 2 #> .. .. .. .. ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> `` #> .. .. .. .. ..$ :<nanoarrow_buffer data<double>[5][40 b]> `1 2 3 4 5` #> .. .. .. ..$ dictionary: NULL #> .. .. .. ..$ children : list() #> .. .. ..$ y:<nanoarrow_array double[5]> #> .. .. .. ..$ length : int 5 #> .. .. .. ..$ null_count: int 0 #> .. .. .. ..$ offset : int 0 #> .. .. .. ..$ buffers :List of 2 #> .. .. .. .. ..$ :<nanoarrow_buffer validity<bool>[0][0 b]> `` #> .. .. .. .. ..$ :<nanoarrow_buffer data<double>[5][40 b]> `6 7 8 9 10` #> .. .. .. ..$ dictionary: NULL #> .. .. .. ..$ children : list() #> .. ..$ dictionary: NULL #> $ dictionary: NULL ``` <sup>Created on 2024-01-29 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup>
- Loading branch information