-
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
Points aren't properly parsed into H3 cells #25
Comments
Interesting - thank you for this report. I just played around with this and was able to reproduce the issue with #[test]
fn central_park_point() {
// Manhattan Central Park
let pt = geo_types::Point::new(-73.9575, 40.7938);
let cells: Vec<_> = h3o::geom::Geometry::from_degrees(geo_types::Geometry::Point(pt))
.unwrap()
.to_cells(Resolution::Eight)
.collect();
dbg!(LatLng::from(cells[0]));
// Using h3-py v3.7.x:
//
// $ python
// Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
// Type "help", "copyright", "credits" or "license" for more information.
// >>> import h3.api.numpy_int as h3
// >>> h3.geo_to_h3(40.7938, -73.9575, 8)
// 613229523021856767
assert_eq!(cells[0], CellIndex::try_from(613229523021856767).unwrap())
} output:
@grim7reaper: Are you aware of any issues like this, or do you see anything I am messing up here? |
Yeah, mistake on my side. When I changed the API to expose degrees by default (instead of radians, which is what H3 uses internally) I forgot to update a conversion method. I've just released a version with the fix. |
Wow - you are fast ;) I see you already released a patch version - @RaczeQ I will also release a bugfix-release soon. |
h3ronpy v0.17.4 with the fix is now on PyPI |
I was testing the library with different geometries, and I found out that points aren't properly matched to their H3 cells. I could filter out the points and parse them using official H3 bindings, but maybe there is an option to properly parse them in this library in a full package. I haven't tested the linestrings / multilinestrings and geometry collections yet.
The text was updated successfully, but these errors were encountered: