geoarrow / geoarrow-r

Extension types for geospatial data for use with 'Arrow'
http://geoarrow.org/geoarrow-r/
Apache License 2.0
155 stars 6 forks source link

Regenerate example files using new wkb writer #6

Closed paleolimbot closed 2 years ago

paleolimbot commented 2 years ago

As noted in #5! With the new WKB writer, we now always write ISO WKB whenever converting to geoarrow.wkb.

library(geoarrow)

tbl <- read_geoarrow_parquet(
  system.file("example_parquet/point_z-wkb.parquet", package = "geoarrow"),
  as_data_frame = FALSE
)

tbl2 <- read_geoarrow_parquet(
  system.file("example_parquet/point_z-wkb.parquet", package = "geoarrow"),
  handler = geos::geos_geometry_writer()
)

unclass(as.vector(tbl$geometry))[[1]]
#>  [1] 01 e9 03 00 00 00 00 00 00 00 00 3e 40 00 00 00 00 00 00 24 40 00 00 00 00
#> [26] 00 00 44 40
geos::geos_write_wkb(tbl2$geometry, flavor = "iso")[[1]]
#>  [1] 01 e9 03 00 00 00 00 00 00 00 00 3e 40 00 00 00 00 00 00 24 40 00 00 00 00
#> [26] 00 00 44 40

Created on 2022-03-24 by the reprex package (v2.0.1)