Calculating square meter area with polygonal geographical coordinates (metric - not DMS system)

63 Views Asked by At

I'm working on a program but my problem is not on software side but mathematical.

I have the following input :

{
   "type":"Feature",
   "id":"64100000BA0033",
   "geometry":{
      "type":"Polygon",
      "coordinates":[
         [
            [
               -1.4796836,
               43.4414704
            ],
            [
               -1.4796624,
               43.441522
            ],
            [
               -1.4797672,
               43.4415449
            ],
            [
               -1.4797607,
               43.4415605
            ],
            [
               -1.47976,
               43.4415624
            ],
            [
               -1.4798095,
               43.4415732
            ],
            [
               -1.479838,
               43.4415041
            ],
            [
               -1.4796836,
               43.4414704
            ]
         ]
      ]
   },
   "properties":{
      "id":"64100000BA0033",
      "commune":"64100",
      "prefixe":"000",
      "section":"BA",
      "numero":"33",
      "contenance":87,
      "created":"2004-10-14",
      "updated":"2018-01-19"
   }
}

This input is, as you can imagine, variable (nbr of points) for every land available in my region. I'd need to know what is the formula to get the area in m² (square meters) from these coordinates.

I hope you can help me.

Thanks !

1

There are 1 best solutions below

3
On

The formula/algorithm you are looking for can be found here: https://en.wikipedia.org/wiki/Shoelace_formula

Some comments for your application:

1) To apply the formula you need to be sure that the order the points are given corresponds to the order they form the outer border of the area you want to measure.

2) Your input data does not to mention units, so you have to make sure to get the conversion right. From the data it looks like the unit is something much bigger than m, maybe km or miles or something else (maybe some angles from a spherical coordinate system; make sure you completely understand what those numbers mean).

3) Make sure to use enough precision in the numerics, as the values are all very much the same and once you start subtracting them your remaining precision will go down much.