-
Notifications
You must be signed in to change notification settings - Fork 3
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
shift in h3 cells when using polyfill at high resolution #26
Comments
@hewag1975 Seems to be a bug, maybe in I highly recommend using h3-r provding bindings to the C library. It's also faster. library(h3)
library(sf)
#> Linking to GEOS 3.6.2, GDAL 2.2.3, PROJ 4.9.3
x <- c(5.0834571999999980, 5.0834387000000003, 5.0834428999999979,
5.0834264999999998, 5.0835604000000005, 5.0835776999999984,
5.0835558999999986, 5.0835739999999978, 5.0834571999999980)
y <- c(52.111907699999954, 52.111928399999996, 52.111929799999992,
52.111948200000000, 52.111993399999989, 52.111974099999998,
52.111966699999996, 52.111946799999998, 52.111907699999954)
p <- st_polygon(x = list(matrix(data = c(x, y), ncol = 2))) %>%
st_sfc(crs = 4326) %>%
st_as_sf()
hexagons <- h3::polyfill(p, res = 14) %>%
h3::h3_to_geo_boundary_sf()
plot(p)
plot(hexagons, add = TRUE) Created on 2020-11-25 by the reprex package (v0.3.0) |
Thanks @crazycapivara, I´ll give it a try. Unfortunately I am on Windows and not really experienced in building C libraries.... |
Tested it directly in the developer console of the browser with the latest h3-js release. Same bug (shift) as above. I think it is due to the numeric precision issues in JavaScript. |
@hewag1975 You may use h3 in a docker container. See also docker-compose. Another options is running it in the WSL (Windows Subsystem for Linux), which worked well for another user. |
Hi,
I am trying to find all h3 indices for building shapes. See the reprex for one specific building below. After selecting all h3 indices in resolution 14 and plotting it using mapview, the h3 cells appear to be shifted.
Not sure if this is a bug or an issue with plotting lat/lon at high zoom levels.
Thanks for any help.
Here´s a reprex:
Created on 2020-11-23 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: