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
Apparent geoToH3 or H3ToGeo bug on master #38
Comments
285.9940373051 is the same longitude as -74.0060. |
Ahh, I see. Still somewhat confusing to me as I'd typically expect Does H3 provide any docs or functions for these sorts of conversions? I think many people often use latitudes in the range -180 to 180, so this kind of thing would tend (I'd think) to confuse other users too. But I'll close for now. |
I will note that the bindings (that haven't been released, yet, hi again @isaacbrodsky :) ) do convert back to -180 -> 180 (and -90 -> 90 for latitude) because that's what people tend to expect. I don't recall why we haven't pushed this down to the C code, but I do know it will cause some churn with the test suite. |
@dfellis good to know as I'm currently writing some bindings of my own (in OCaml). I expect to have them on github in the next week or so. |
I'm OK with changing the C library/applications/examples to return negative angles, since that's what the bindings do anyways. (hi @dfellis :) ) Or, we should add this to the bindings documentation. @travisbrady Please feel free to open a PR to add your bindings to the bindings list when you feel they're ready. |
I'd support updating the C lib here. I think it subverts user expectations, and agree with @travisbrady's point that it breaks assumptions about round-trip stability. |
I should point-out that, unless you limit |
True, but we could guarantee stability for a defined valid input range, and
I think it would be closer to user expectations to define that range as
-180 - 180.
…On Thu, Mar 29, 2018 at 9:52 AM sahrk ***@***.***> wrote:
I should point-out that, unless you limit geoToH3 to only accept
longitudes in the range +/-180 (which I don't recommend), then geoToH3/
h3ToGeo can't be completely round-trip stable, in the sense that the user
will necessarily get back their input longitude value in the original input
range.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAKAZNJCePNvlFXnoLXBQHSHGOpSLYyLks5tjRFUgaJpZM4S70pQ>
.
|
Resolved this generally... the input was incorrect (130 is not a lat), but bit concerning that the two libraries give different results for the same input.
Using the Python library --
|
I used
geoToH3
to encode the coordinates for NYC and then ran the H3 hex string throughH3toGeo
and got a confusing result.This is with a fresh clone of master built per readme instructions and running on a Mac.
Then
Unless I misunderstand the purpose of these tools, 285.9940373051 is obviously an illegal value and far from the expected -74.0060.
The text was updated successfully, but these errors were encountered: