-
Notifications
You must be signed in to change notification settings - Fork 18
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
more accurate area and length calculation #193
Conversation
4fe61d1
to
c493393
Compare
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.
I didn't do the math, so I hope this is right, but the code looks good :-) 👍
a45c158
to
f65c1db
Compare
makes formulas partially account for the non-spherical shape of the earth (but keeps using spherical approximation for the calculations). resulting relative errors are now consistently below 0.1% for "small" features (as typically found in OSM). for comparison: before, areas were sometimes off by a few percent, and lengths typically below half a %
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.
Code change looks good
oshdb-util/src/main/java/org/heigit/bigspatialdata/oshdb/util/geometry/Geo.java
Outdated
Show resolved
Hide resolved
f65c1db
to
b1c07df
Compare
I think this is ready to be merged. Benchmarks would still be nice, but I think the higher accuracy should be worth it in any case. Also, this only adds a few more trig calls, so the performance should be in the same ballpark as before. |
makes formulas partially account for the non-spherical shape of the earth (but keeps using spherical approximation for the calculations).
resulting relative errors are now consistently below 0.1% for "small" features (as typically found in OSM). for comparison: before, areas were sometimes off by a few percent, and lengths typically below half a %
also moves a few implementation functions from public to private
Changes proposed in this pull request:
Type of change
Checklist
🚧 WIP