Polygon area calculation using Latitude and Longitude generated from Cartesian space and a world fil
Posted
by Heath
on Stack Overflow
See other posts from Stack Overflow
or by Heath
Published on 2010-05-18T21:27:27Z
Indexed on
2010/05/18
21:30 UTC
Read the original article
Hit count: 364
Given a series of GPS coordinate pairs, I need to calculate the area of a polygon (n-gon). This is relatively small (not larger than 50,000 sqft). The geocodes are created by applying an affine transform with data from a world file.
I have tried to use a two step approach by doing converting the geocodes to cartesian coordinates:
double xPos = (lon-lonAnchor)*( Math.toRadians( 6378137 ) )*Math.cos( latAnchor );
double yPos = (lat-latAnchor)*( Math.toRadians( 6378137 ) );
then I use a cross product calculation to determine the area.
The issue is that the results are a bit off in accuracy (around 1%). Is there anything I can look into to improve this?
Thanks.
© Stack Overflow or respective owner