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

Passing command line arguments to st_read #1192

Closed
davidorme opened this issue Nov 13, 2019 · 3 comments
Closed

Passing command line arguments to st_read #1192

davidorme opened this issue Nov 13, 2019 · 3 comments

Comments

@davidorme
Copy link

Is there a way to pass OGR command line options in st_read? The specific use case is that I wanted to load a small spatial subset of a large file, which I'd do on the command line using -spat xmin ymin xmax ymax. The query argument works beautifully for getting a subset by feature attribute, but not spatial queries.

More of a feature request than an issue...

@edzer edzer closed this as completed in 8e897e4 Nov 14, 2019
@edzer
Copy link
Member

edzer commented Nov 14, 2019

Good idea! See https://github.com/r-spatial/sf/blob/master/tests/read.R#L139-L144 for an example.

@edzer
Copy link
Member

edzer commented Nov 14, 2019

I chose to pass a geometry as WKT, rather than four numbers; I believe the implementation by OGR in the end is identical, in the sense that overlap with bounding box is given; see here.

edzer added a commit that referenced this issue Nov 14, 2019
edzer added a commit that referenced this issue Nov 14, 2019
@davidorme
Copy link
Author

Perfect. Thanks, Edzer.

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

2 participants