If the rasters have discrete values (which you imply) I would dump out polygons from the rasters using ST_DumpAsPolygons (http://postgis.net/docs/RT_ST_DumpAsPolygons.html) and then use pure geometry-functions to calculate intersections between your city polygons and your new coverage polygons.
Calculating areas etc. from the individual geometries and intersections is also going to be easy with this approach. -ra On 16 Apr 2015, at 20:24, Roberto Lazarte Kaqui <[email protected]> wrote: > I have a raster with one band that represents the deforested area in the > Amazon. This raster has 13 categories representing the deforested area in > each year from 2001 to 2013. > Beyond this raster data, i have a database with 800 polygons that represents > 800 cities of the Amazon region. > > My interest is calculate the total deforested area in each city of the region > for each year. In other words, i need to calculate the intersection area > between the raster and the polygons database for each category of the raster. > In this scenario, i have two main questions: > > 1 - What's the best way to do raster/polygon intersections? I read about two > different approaches, one using ST_Intersection and the other one using > ST_Clip. The second one apparently is faster and more efficient, but i don't > know about its precision. > > 2 - Assuming that i used ST_Clip to do the intersections, the result it’s > gonna be another raster. How can i calculate the area of each category of > this raster? > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
