My data has 2 fields holding landuse types, which both describe what is within the polygon. For example, the polygon may have Type1=Retail, Type2=Leisure Area= 1 but another polygon has Type1=Leisure, Type2=Swimming Pool Area=3
I want to discover the total area of polygons with a Retail attribute, Leisure attribute etc.. to build a table like:
Retail 1 Leisure 4 Swimming Pool 3
etc. Of course some polygons will be counted in multiple categories, but this is ok for what I am working on.
In some cases the polygon might have Type1= Retail, Type2= Retail. In this case the area should only be counted once.
Can I ask PostGIS to sum the areas for all of the values it finds in the fields, without me having to write/run a query for each of the types (there are a lot)?