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

Expose the query argument of sf::read_sf() where useful #188

Open
florisvdh opened this issue Sep 19, 2024 · 0 comments
Open

Expose the query argument of sf::read_sf() where useful #188

florisvdh opened this issue Sep 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@florisvdh
Copy link
Member

Functions that read a spatial vector data source could expose the query argument of sf::read_sf() in order to pass an SQL statement to the GDAL driver (https://gdal.org/en/latest/user/ogr_sql_dialect.html).

This could be useful in functions that read large datasets (such as the raw soilmap and habitatmap data sources), when interest is only in a filtered part of the data source. To be investigated is whether the gain in reading timing is large enough, as executing the query will also take some time. The gain in memory should be obvious anyway; it will depend on the relative object sizes.

At least one pitfall to be investigated is whether this could cause unwanted side effects during the preprocessing done by the function. One example may be a different number of factor levels that might result for a specific column. Whether that is a problem in need of another solution, must be assessed on a case-by-case basis.

@florisvdh florisvdh added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant