java - An exact method of area calculation using UTM coordinates -


i have list of lat/long coordinates use calculate area of polygon. can exact in many cases, larger polygon gets, higher chance error.

i first converting coordinates utm using http://www.ibm.com/developerworks/java/library/j-coordconvert/

from there, using http://www.mathopenref.com/coordpolygonarea2.html calculate area of utm coordinates.

private double polygonarea(int[] x, int[] y) {           double area = 0.0;     int j = x.length-1;     for(int = 0; < x.length; i++) {         area = area + (x[j]+x[i]) * (y[j]-y[i]);         j = i;     }     area = area/2;     if (area < 0)         area = area * -1;     return area; } 

i compare these areas same coordinates put microsoft sql server , arcgis, cannot seem match them time. know of more exact method this?

thanks in advance.

edit 1

thank comments. here code getting area (coordinateconversion code listed above on ibm link):

private map<integer, geopoint> vertices;  private double getarea() {     list<integer> xpoints = new arraylist<integer>();     list<integer> ypoints = new arraylist<integer>();     coordinateconversion cc = new coordinateconversion();     for(entry<integer, geopoint> itm : vertices.entryset()) {         geopoint pnt = itm.getvalue();         string temp = cc.latlon2mgrutm(pnt.getlatitudee6()/1e6, pnt.getlongitudee6()/1e6);         // example return cc: 02cnr0634657742         string easting = temp.substring(5, 10);         string northing = temp.substring(10, 15);         xpoints.add(integer.parseint(easting));         ypoints.add(integer.parseint(northing));     }      int[] x = tointarray(xpoints);     int[] y = tointarray(ypoints);      return polygonarea(x,y); } 

here example list of points:

44.80016800 -106.40808100 44.80016800 -106.72123800 44.75016800 -106.72123800 44.75016800 -106.80123800 44.56699100 -106.80123800 

in arcgis , ms sql server 90847.0 acres. using code above 90817.4 acres.

another example list of points:

45.78412600 -108.51506700 45.78402600 -108.67972100 45.75512200 -108.67949400 45.75512200 -108.69962300 45.69795400 -108.69929400 

in arcgis , ms sql server 15732.9 acres. using code above 15731.9 acres.

the area formula using valid on flat plane. polygon gets larger, earth's curvature starts have effect, making area larger calculate formula. need find formula works on surface of sphere.

a simple google search "area of polygon on spherical surface" turns bunch of hits, of interesting wolfram mathworld spherical polygon


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -