# If my geometry is stored in 4326 / WGS 1984 what should I transform to for the most accurate area in sq m?

I've got a plot of land in Texas that is (WKT):

``````MULTIPOLYGON (((-98.12317899283 26.29444331481,
-98.12355263136 26.29220720658, -98.1274736313 26.29279476234,
-98.12691816383 26.29544258344, -98.12532028286 26.29498101405,
-98.12321790601 26.29467334228, -98.12317899283 26.29444331481)))'
``````

I'd like to calculate the area in sq m. We are storing the data as 4326 in PostgreSQL. We also need to calculate values for plots in CAN and BRA, so really it's safest to go with "anywhere in the western hemisphere".

Current code is

``````ST_Area(ST_Transform(\$1, 5070)) as area_sq_m
``````

I'm prototyping so I'm setting `\$1` when I run the script using `ST_GeomFromText` with 4326 as the 2nd arg. This gives me 109458.48788528093 sq m.

Which SRID should I use for this calculation? What are the tradeoffs?

• US CONUS Albers certainly wouldn't work for Texas, Canada and Brazil. The bad news is that this is an opinion-based Question. The good news is that studying up on projections would allow you to have a good opinion. Or you can just use a geodesic calculation in `geography`. Sep 15 at 1:06

Cast to `geography` and use use `ST_Area` to calculate area with units m².

``````SELECT ST_Area('MULTIPOLYGON (((-98.12317899283 26.29444331481,
-98.12355263136 26.29220720658, -98.1274736313 26.29279476234,
-98.12691816383 26.29544258344, -98.12532028286 26.29498101405,
-98.12321790601 26.29467334228, -98.12317899283 26.29444331481)))'::geography);
``````

109458.59346706979

This method works anywhere, does not need a projected CRS, and has a high accuracy.

• We have some existing code around that is deriving an SRID based on lat/long -- would that be more accurate than casting to geography? Sep 15 at 19:34
• Areas based on projections tend to get distorted near the edges, so are not as good. Geodesic areas done by ST_Area with geography type don't have such distortions, and are accurate; more on the algo used in PostGIS here Sep 17 at 3:41
• that's good info thanks Sep 18 at 15:12
• The only other answer I have to this question says use local coord system and you're saying do not use local coord system, yes? So how do I determine which is right? Is there some sort of reference polygon I can drop into my calculation to verify? Sep 18 at 15:21
• Both methods work fine. This method has high precision for an area on a curved surface, if that's your metric of "area". However, many folks operate on flat maps via local projections which you can also get a flat area. So it's a matter if you want a flat or curved area. Sep 18 at 21:02

For highest accuracy, you would want to transform to a local coordinate system. For Texas it seems to be broken down into 5 state plane zones(EPSGs:32137,32138,32139,32140,32141). But the easiest (slightly less accurate), is using UTM zones. Still Texas intersects 3 different zones (EPSGs: 26913, 26914 and 26915). Once you decide on the coordinates you want to use, I would build an other table in our database with polygons and the associated EPSG. This way you can join them by intersection and apply the right transformation to each item you need to measure.

• Did you see "We also need to calculate values for plots in CAN and BRA" ? Sep 15 at 15:28
• Yes, the same applies there, canada has province based coordinate sustem which are used often by the forestery industry. Example: BC Albers in british columbia ( Espg:3005). But again easier to use UTM zones N 7-22 ( 26907,26908,26909,26910, etc) Sep 16 at 21:30
• Same goes for brazil but you’d want to use a southern emisphere utm sustem like Sad 96. Eg. Espg 5875 Sep 16 at 21:42