Skip to content
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

Closed
m4gr3d opened this issue Jul 1, 2014 · 9 comments
Closed

Fix failing unit tests #842

m4gr3d opened this issue Jul 1, 2014 · 9 comments
Labels

Comments

@m4gr3d
Copy link
Member

m4gr3d commented Jul 1, 2014

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.

@arthurbenemann
Copy link
Member

@squilter wanna try this?
With the merge of #938 running the unit tests on Eclipse is super easy. Just tell eclipse to run the Core project, as a junit test.

To work out this issue remove the commented line at Core/test/org/droidplanner/core/helpers/geoTools/GeoToolsTest.java and work your way though the math.

@squilter
Copy link
Member

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:

@squilter wanna try this?
With the merge of #938 running the unit tests on Eclipse is super easy.
Just tell eclipse to run the Core project, as a junit test.

To work out this issue remove the commented line at
Core/test/org/droidplanner/core/helpers/geoTools/GeoToolsTest.java
and work your way though the math.


Reply to this email directly or view it on GitHub:
#842 (comment)

@squilter
Copy link
Member

@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.

@squilter squilter removed their assignment Aug 21, 2014
@arthurbenemann
Copy link
Member

getArea() should be used on the mapping/survey stuff. And it's super important.

@Thalek
Copy link

Thalek commented Aug 21, 2014

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.

@squilter
Copy link
Member

@arthurbenemann You've taken more math classes than me, so maybe you understand some of this stuff:
https://stackoverflow.com/questions/1340223/calculating-area-enclosed-by-arbitrary-polygon-on-earths-surface

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.

@arthurbenemann
Copy link
Member

@Thalek
Copy link

Thalek commented Aug 21, 2014

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

@Thalek
Copy link

Thalek commented Aug 21, 2014

Perhaps the "Surveyor's Formula"? http://en.wikipedia.org/wiki/Surveyor%27s_formula#Area_and_centroid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants