2

I have a Python script that has a line that takes the geometry and calculates it into a square feet value by multiplying the area by 10.7639 in a geopandas dataframe.

bldg_feat_poly_df['bldg_sqft'] = bldg_feat_poly_df.geometry.area * 10.7639

This works fine. I am now trying to do the same in PostgreSQL using PostGIS. I believe that ST_Area is the correct method to use:

SELECT
ST_Area(geom) * 10.7639 AS bldg_sqft
FROM my_schema.my_table

Looking at the ST_Area documentation , it looks like it automatically calculates the value as square feet. My geometry is already in SRID=102008/North America Albers Equal Area Conic projection. Should I just use ST_Area(geom) AS bldg_sqft ?

1 Answer 1

4

st_area is the correct function to use to get a geometry area, expressed in the CRS unit.

102008 unit is meters, so the output will be in square meters, and you would still have to apply the conversion factor

2
  • So, ST_Area(geom) * 10.7639 AS bldg_sqft would be correct then?
    – gwydion93
    Dec 22, 2021 at 18:17
  • 1
    yes, as 1m2 = 10.7639ft2
    – JGH
    Dec 22, 2021 at 18:18

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.