-
Notifications
You must be signed in to change notification settings - Fork 7
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 vec_equal support to wk_wkb vectors #183
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #183 +/- ##
=======================================
Coverage 99.03% 99.03%
=======================================
Files 81 81
Lines 5888 5918 +30
=======================================
+ Hits 5831 5861 +30
Misses 57 57
☔ View full report in Codecov by Sentry. |
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.
Thank you! All just details 🙂
Is it worth exposing the "convert to hex" in any other way? It is probably useful in other contexts as well...maybe wkb_to_hex()
or something?
It could be useful. I can add |
Should 2 identical features with different endianness be considered equal? Should # remotes::install_github("paleolimbot/wk#183")
library(wk)
points <- wkt(c("POINT (1 1)", "POINT (2 2)"))
points_le <- wk_handle(points, wkb_writer(endian = 1))
points_be <- wk_handle(points, wkb_writer(endian = 0))
vctrs::vec_equal(points_le, points_be)
#> [1] FALSE FALSE
vctrs::vec_order(points_le) == vctrs::vec_order(points_be)
#> [1] FALSE FALSE Created on 2023-07-11 with reprex v2.0.2 |
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.
Regarding wkb_to_hex()
...I'm happy to review that as part of this PR if you'd like to add it and test it (otherwise feel free to omit but open an issue so I don't forget to add it before the next release).
Regarding vec_equal()
with different endians...I would personally consider the current behaviour (point_le != point_be
) sufficient. If you truly need geometric equality, you will need a geometry engine (e.g., geos_equal()
)...using ==
with wkb()
or wkt()
will always miss some things a user might consider "equal".
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
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.
Just one nit! Thank you!
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
I've exported |
Thanks! (FWIW, it's usually good practice to rebuild the documentation yourself) |
Adds
vctrs::vec_equal()
support forwk_wkb
vectors.Closes #181