-
Notifications
You must be signed in to change notification settings - Fork 8
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
enable full info() on vector-via-sql #615
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Let me know your preference on the possible edit and then I'll merge.
R/gdalvector.R
Outdated
#' prints the DSN and SQL. | ||
#' `cl_arg = c("-so", "-nomd")`, and for layers open with a SQL statement, | ||
#' calls [ogrinfo()] passing the command options | ||
#' `cl_arg = c("-so", "-nomd", "-sql", <layer>)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really minor I know, but instead of ... "-sql", <layer>)
I'm thinking it should say ... "-sql", <statement>)
, since that would match the ogrinfo
command-line documentation at https://gdal.org/en/stable/programs/ogrinfo.html#ogrinfo (and you pass R_NilValue
for the layer and m_layer_name
in this case actually contains the sql statement).
Acknowledge it's not exactly clean relative to the GDALVector constructor where we only have layer
which can be layer name or SQL statement, but since these are ogrinfo cl options I sort of think it should match to that. Your call, feel free to keep it the way it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great catch, I didn't think to look at ogrinfo
@@ -1079,7 +1079,7 @@ test_that("info() prints output to the console", { | |||
lyr$close() | |||
|
|||
lyr <- new(GDALVector, dsn, "SELECT * FROM mtbs_perims LIMIT 10") | |||
expect_output(lyr$info()) | |||
expect_output(lyr$info(), "Feature Count: 10") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me realize I have several expect_output
that are missing some specific text to check for! Will fix at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was very happy to see that expect_output was as sophisticated as it is ;)
I'll include the edit as I've been working with that already. |
Implementation of #614