-
Notifications
You must be signed in to change notification settings - Fork 557
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
Fix failing unit tests #842
Comments
@squilter wanna try this? To work out this issue remove the commented line at |
I won't have access to a computer for about 3 weeks. If there's no hurry, I'll do it then. On July 28, 2014 1:18:32 PM PDT, Arthur Benemann [email protected] wrote:
|
@TShapinsky and I just spent altogether too much time trying to figure this one out, to no avail. We suspect it has to do with the curvature of the earth. The (incorrect) formula that is currently used is meant for irregular polygons on a flat surface, not on a sphere. Calculating the area of an irregular polygon on a sphere is very difficult. It doesn't seem worth the trouble considering that getArea() is never used. |
|
Googling "mapping an irregular polygon on the surface of a sphere" to see if other programmers have an answer. I'm pretty sure the problem has already been solved, so now we have to find out how it was solved. I'll let you know what I find, but I lack the math to be capable of verifying usefulness. |
@arthurbenemann You've taken more math classes than me, so maybe you understand some of this stuff: Using google earth, we were able to confirm that the unit test was set up correctly (the number 502915 m^2 was accurate to within a couple dozen m^2). Clearly the getArea() method is currrently wrong. I suspect that the 2d polygon formula is good enough for most small polygons, and it seems to be implemented correctly (or maybe that minus should be a plus). I think the problem lies in projecting the coordinates onto a 2d surface. |
@squilter Spherical integrals, you gotta miss that. I think I found a nice implementation: |
I saw that one, but you beat me to the punch. [grin] I wonder if this article might help? http://en.wikipedia.org/wiki/Area |
Perhaps the "Surveyor's Formula"? http://en.wikipedia.org/wiki/Surveyor%27s_formula#Area_and_centroid |
A couple unit tests in
Core/test/org/droidplanner/core/helpers/geoTools/GeoToolsTest.java
are currently failing, and have been commented out to pass the build process.The text was updated successfully, but these errors were encountered: