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

.gpkg_process_sources() should be more robust to various OGR sources #15

Closed
brownag opened this issue Feb 12, 2024 · 2 comments · Fixed by #16
Closed

.gpkg_process_sources() should be more robust to various OGR sources #15

brownag opened this issue Feb 12, 2024 · 2 comments · Fixed by #16
Labels
bug Something isn't working

Comments

@brownag
Copy link
Owner

brownag commented Feb 12, 2024

Currently just a small number of file path extensions for raster and vector data are used to identify paths to possible spatial data sources.

Nobody has complained, and I guess it has worked fine for me, but I should have generalized this a long time ago...

I am now thinking perhaps the functionality to support and classify arbitrary file paths in the same call to gpkg_write() might be too general. The main reason using file extensions is necessary is because either terra::rast() or terra::vect(), or a non-spatial table function, needs to be called based on whether a file input is determined to be is a raster, vector, or attribute.

  • Can I create a lookup table of file extensions from file based sources found in terra::gdal(drivers=TRUE)?

  • Could I pass an argument so that user needs to specify whether they are writing raster, vector, or attributes? Meaning 1 type per call, or a vector of equal length to the input list denoting data type? Both of these alternate options seem rather cumbersome in comparison to how it works now.

@brownag brownag added the bug Something isn't working label Feb 12, 2024
@brownag
Copy link
Owner Author

brownag commented Feb 19, 2024

A semi-related issue is that it may sometimes be desirable to transfer between OGR sources without reading them into memory. Minimal support for querying and writing a SpatVectorProxy for an arbitrary source was added in 8f3cae4... but a more general solution would use an ogr2ogr-like interface, rather than going through a SpatVector/R intermediate object.

@brownag
Copy link
Owner Author

brownag commented Feb 28, 2024

This could probably be resolved using {vapour}!

system.file("ex","lux.shp",package="terra") |> 
  vapour::vapour_driver()

@brownag brownag linked a pull request Mar 2, 2024 that will close this issue
brownag added a commit that referenced this issue Mar 2, 2024
* Implement GDAL driver detection via {vapour} for #15

* Update docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant