Comments (9)
285.9940373051 is the same longitude as -74.0060. h3ToGeo
gives longitude values in the range 0-360 degrees.
from h3.
Ahh, I see. Still somewhat confusing to me as I'd typically expect ThingToInt(IntToThing(blah)) == blah
.
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.
from h3.
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.
from h3.
@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.
from h3.
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.
from h3.
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.
from h3.
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.
from h3.
from h3.
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.
There is a problem still.
Using the example, I expect h3_to_geo(geo_to_h3(lat,lon), resolution) to return the original lat,lon input, or something quite nearby... If I use the example, this is true, but if I do it in Australia, its not true -- the [-180,180] bounds are respected but the answer is shifted by 180:
11:37 AM gacafe ∈ h3 (master) ./bin/geoToH3 -r 15
130.90938479800002 -12.365644588
8f16c6d624a25a8
11:38 AM gacafe ∈ h3 (master) ./bin/h3ToGeo
8f16c6d624a25a8
49.0906178199 167.6343623402
Using the Python library --
>>> h3_address = h3.geo_to_h3(37.3615593, -122.0553238, 15)
>>> hex_center_coordinates = h3.h3_to_geo(h3_address)
>>> hex_center_coordinates
[37.36156313952111, -122.05532505846305]
>>> h3_address = h3.geo_to_h3(130.90938479800002, -12.365644588,15)
>>> hex_center_coordinates = h3.h3_to_geo(h3_address)
>>> hex_center_coordinates
[-49.09061440581596, -12.36565153299568]
from h3.
Related Issues (20)
- illegal instruction on ppc64 big endian server HOT 2
- h3.exact_edge_length execution error HOT 4
- PloygonAlgos - Throws error when used wrapper library in swift HOT 2
- About RFC: Polyfill modes release plan HOT 1
- replace `sprintf` with `snprintf` HOT 1
- Add additional modes for polygonToCells HOT 12
- Hex (cell) ID validation HOT 3
- Fuzzer timeout on fuzzerIj: gridPathCells
- Broken Link to website docs in contributing.md
- Broken link to website in contributing docs
- Uber CLA Contact HOT 1
- Has cell_to_vertex been implemented? HOT 2
- Replace empty function parameters with `void` HOT 1
- cell_to_child_pos() version 4 of the Python API client HOT 3
- polygonToCells: validity of polygons HOT 3
- Missing library stubs MYPY HOT 2
- polygonToCells not returning all H3Cells for the bounding box containing both USA and Russia HOT 1
- Confirmation of grid algorithm HOT 3
- cellToChildren error HOT 2
- Add function for returning the H3 indices of each endpoint of a directed edge HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h3.