2

How to calculate the area of a polygon given its coordinates?

{"type":"MultiPolygon","coordinates": [[[[40.92344999,57.76796047], [40.92299938,57.76776019], [40.92268825,57.76796619], [40.92312813,57.76816647], [40.92312813,57.76816647], [40.92344999,57.76796047]]]]}

It uses the same method as in Area of a polygon but does the arithmetic for you. Polygon area calculator Area=1.551079549

enter image description here

2 Answers 2

2

You can find the area using SQL/PostGIS in CartoDB by using ST_Area. You can run this in your SQL editor:

SELECT *, ST_Area(the_geom::geography) area FROM untitled_table_1

It will calculate the area for the object in each row and adds a temporary column to your table called area that give the area in square meters.

2
  • As more complete: SELECT ST_Area(ST_GeomFromText('MULTIPOLYGON (((40.92344999 57.76796047,40.92299938 57.76776019,40.92268825 57.76796619, 40.92312813 57.76816647, 40.92312813 57.76816647, 40.92344999 57.76796047)))',4326)::geography); And the result is 1028.11563305801.
    – user30184
    Apr 10, 2015 at 13:32
  • Andy Eschbacher Thank you for your valuable advice. Everything turned out! And as for your fomula to calculate the number of polygons? (their coordinates are also known) which means that number? )))',4326) Thank you. You are a magician :) Apr 11, 2015 at 14:14
0

The shoelace formula is what you need. A full example is given in this answer in python.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.