geoarrow/geoarrow-r

geoarrow still drops CRS

Opened this issue · 0 comments

Hello, I see that #16 is marked as closed. However I still encounter this issue on a newly installed version of the package on Windows (R 4.2.2).

library(geodata)
# Fetch data and transform to sf
countries <- world(resolution=2, level=0, path = ".") 
countries <- st_as_sf(countries)

# Write and read the output
write_geoparquet(countries, "countries.parquet")
countries_reload <- read_geoparquet("countries.parquet")

# There is no crs in the reloaded file
st_crs(countries_reload)
# Coordinate Reference System: NA

# There was one in the initial object
st_crs(countries)
# Coordinate Reference System:
#   User input: GEOGCRS["unknown",
#     DATUM["World Geodetic System 1984",
#         ELLIPSOID["WGS 84",6378137,298.257223563,
#             LENGTHUNIT["metre",1]],
#         ID["EPSG",6326]],
#     PRIMEM["Greenwich",0,
#         ANGLEUNIT["degree",0.0174532925199433],
#         ID["EPSG",8901]],
#     CS[ellipsoidal,2],
#         AXIS["longitude",east,
#             ORDER[1],
#             ANGLEUNIT["degree",0.0174532925199433,
#                 ID["EPSG",9122]]],
#         AXIS["latitude",north,
#             ORDER[2],
#             ANGLEUNIT["degree",0.0174532925199433,
#                 ID["EPSG",9122]]]] 
#   wkt:
# GEOGCRS["unknown",
#     DATUM["World Geodetic System 1984",
#         ELLIPSOID["WGS 84",6378137,298.257223563,
#             LENGTHUNIT["metre",1]],
#         ID["EPSG",6326]],
#     PRIMEM["Greenwich",0,
#         ANGLEUNIT["degree",0.0174532925199433],
#         ID["EPSG",8901]],
#     CS[ellipsoidal,2],
#         AXIS["longitude",east,
#             ORDER[1],
#             ANGLEUNIT["degree",0.0174532925199433,
#                 ID["EPSG",9122]]],
#         AXIS["latitude",north,
#             ORDER[2],
#             ANGLEUNIT["degree",0.0174532925199433,
#                 ID["EPSG",9122]]]]