I work with PostGreSQL and have 2 tables, both in EPSG 2950:
Table 1 has a couple of big polygons and table 2 has smaller polygons that INTERSECTS with the polygons of table 1.
I am looking for a function to calculate the area of the portions of the polygons of table 2 that are WITHIN the polygons of table 1.
Having no idea how such a formula would look, i tried the following:
ALTER TABLE table_1 ADD COLUMN area NUMERIC (10,2);
UPDATE table_1 SET area = ST_Area((ST_Within(table_2.geom, table_1.geom)));
The resulting error was that there was a missing entry for the FROM clause for table_2.
I tried adding the FROM before and than after my SET constraint but both turned out with errors.
Any idea about what would be missing in my function?