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
Add precision variable to geojson_list() #152
Conversation
thanks @ChrisJones687 having a look |
Thanks for this, but did you run the tests that you added? It fails because you have |
… affecting user calls that rely on order without variable names.
R/geojson_list.R
Outdated
@@ -11,6 +11,9 @@ | |||
#' GeometryCollection. | |||
#' @param group (character) A grouping variable to perform grouping for polygons - doesn't apply | |||
#' for points | |||
#' @param precision desired number of decimal places for the coordinates in the | |||
#' geojson file. Using fewer decimal places can decrease file sizes (at the | |||
#' cost of precision). |
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 think we need to add here that this works up to a point, that point being the value of getOption("digits")
. If you want more digits than precision
allows, then fiddle with options(digits = <some number>)
can you add an example or two of using the parameter? |
Examples added and adjusted language on the precision argument. |
thanks! a few things to fix, but i'll do that after merge |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Description
Added precision argument to geojson_rw() with default to NULL to avoid changing behavior when the argument isn't used. Then used this change to add precision to geojson_list() specifically for all sp class calls. I haven't tested this for non-sp classes yet.
Related Issue
related to #141 for the case when converting from sp classes to geoJSON.
Example
test added for precision for sp polygons works with other sp classes