I remove all unnessary symbols from this list and create a new list " modified point list to be :
39.921443718046866,116.39669618904591
39.923277899436115,116.40098772346974
39.921935123497676,116.40411920249463
39.91822664024689,116.4033950060606
39.91815235278837,116.3982351064682
and add each point by CalculateMapArea extension
but the extension give me wrong result for any shape i draw after that !!!
II compared the result of the extension with the result of the Google Earth program on the computer, the result of the first shape is true , but any shape i draw after give me a big difference in area.
You wrecked the JSON list structure when you did that.
You could have used a Web1.JSONTextDecode block and preserved the table structure you need to traverse the points.
further to @Ramon 'd solution, there is some python code
import math
def ComputeArea(data):
arr = data.split(';')
arr_len = len(arr)
if arr_len < 3:
return 0.0
temp = []
for i in range(0,arr_len):
temp.append([float(x) for x in arr[i].split(',')])
s = temp[0][1] * (temp[arr_len -1][0]-temp[1][0])
print s
for i in range(1,arr_len):
s += temp[i][1] * (temp[i-1][0] - temp[(i+1)%arr_len][0])
return round(math.fabs(s/2)*9101160000.085981,6)
data format like
data = "115.989099,39.646023;115.987394,39.645988;115.987371,39.647407;115.986684,39.647423;115.986602,39.648088;115.989095,39.648151;115.989188,39.646021;115.989099,39.646023"
but I am afraid it will be not so accurate if the locations is far away from equator.
Any equation that uses longitude coordinates to create a polygon to determine the polygon's area needs to consider the latitude at which the polygon is made. The length the method uses for longitude in the area calculation needs to be 'corrected' or adjusted.
Why?
The length of each degree of latitude is about 111.111 km or 111,111 meters and is relatively consistent at all latitudes.
Each degree of longitude at the equator is equivalent to about 111.111 meters. But moving away from the equator towards either of the poles the distance represented by the longitude gets smaller; the lines become closer. The distance represented by a longitude line then becomes approximately 111,111 * cos(latitude) where 'latitude' is the approximate latitude of the polygon you are 'measuring'.
Deg. latitude longitude
0° 110.574 km 111.320 km
15° 110.649 km 107.551 km
30° 110.852 km 96.486 km
45° 111.133 km 78.847 km
60° 111.412 km 55.800 km
75° 111.618 km 28.902 km
90° 111.694 km 0.000 km
For a location that is at 45 deg. latitude, the longitude length is not 111 km but about 79 km.
@Eng_A.Abdelaty
Either the extension or algorithm from Google Earth assumes the length of latitude and longitude everywhere in the polygon is the same; which is not true. If the methodology to determine the polygon's area does not consider the variation in the length of longitude as latitude varies, it will produce erroneous results. Which is correct; the extension or Google Earth? I don't know.