Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st_write support GeoParquet #2506

Open
arthurgailes opened this issue Feb 13, 2025 · 13 comments
Open

st_write support GeoParquet #2506

arthurgailes opened this issue Feb 13, 2025 · 13 comments

Comments

@arthurgailes
Copy link
Contributor

As of 1.0-19, writing (geo)parquet files doesn't seem to work. It's supported in GDAL, but not included in st_drivers(). This issue is mentioned in an old thread #1756, but I'm not sure what the status is.

st_read(system.file("shape/nc.shp", package="sf")) |> 
  st_write("test.parquet", driver = "GeoParquet")

driver `GeoParquet' not available.
Error: Driver not available.

Thanks for your time.

@rsbivand
Copy link
Member

rsbivand commented Feb 13, 2025

Please report your operating system and how you installed sf. Not all GDAL installations are built with support for the same sets of drivers; this is not under the control of sf.

@yutannihilation
Copy link
Contributor

yutannihilation commented Feb 13, 2025

It seems the driver name is Parquet, not GeoParquet. (edit: this result is on my Manjaro Linux, which installed GDAL and Arrow from the distro's official repository, and built sf from source.)

sf::st_drivers() |>
  dplyr::filter(name == "Parquet")
#>            name    long_name write  copy is_raster is_vector  vsi
#> Parquet Parquet (Geo)Parquet  TRUE FALSE     FALSE      TRUE TRUE

@yutannihilation
Copy link
Contributor

Just in case this is useful, I found no Parquet driver on my Windows. It seems Rtools' GDAL (v3.10.1 at the latest) doesn't have support for GeoParquet.

@rsbivand
Copy link
Member

@yutannihilation the OS and how sf and GDAL were installed also matter apart from spelling.

@yutannihilation
Copy link
Contributor

Sorry, I added these information on my first comment! It was the result on my Manjaro Linux laptop.

@rsbivand
Copy link
Member

@yutannihilation Thanks for your help! As far as I know, the CRAN Windows and macOS static binary builds omit the GDAL vector "Parquet" and "Arrow" drivers. Different Linux package management systems may choose to include or exclude the upstream software needed to include these drivers.

@yutannihilation
Copy link
Contributor

Oh, good to know the situation about Windows and macOS. Thanks for sharing the details!

@arthurgailes
Copy link
Contributor Author

Please report your operating system and how you installed sf. Not all GDAL installations are built with support for the same sets of drivers; this is not under the control of sf.

Present on both Windows 10 and Windows server 2016. Installed via install.packages.

@rsbivand
Copy link
Member

@arthurgailes The current sf Windows static binary package 1.0-19) (built with current Rtools44 (6414) does not include the Parquet or Arrow drivers. There are traces in the sf source of attempts to use nanoarrow, to read through a stream interface, but I think that this is not user-ready (not tried).

@kadyb
Copy link
Contributor

kadyb commented Feb 14, 2025

Here was similar thread in terra with responses from Dewey and Tomas: rspatial/terra#1347

@rsbivand
Copy link
Member

@kadyb thanks, very useful!

@edzer
Copy link
Member

edzer commented Feb 14, 2025

With my ubuntu 24.04 and ubuntugis-unstable ppa I couldn't read geoparquet files, but in a docker image with this Dockerfile I could.

@kendonB
Copy link
Contributor

kendonB commented Mar 5, 2025

This seems to work quickly following the example at https://github.com/geoarrow/geoarrow-r if googlers are looking for a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants