Given a polygon in a PostGIS database, what is the best way to create a graph of its distribution over a range of latitudes? I'm picturing a graph of a curve, where the proportion of the total area under the curve that lies between two points on the x-axis (latitude) represents the proportion of the polygon's area between those latitudes. The tools I have at my disposal are PostGIS and R. It seems like this should be a fairly routine exercise for which there are well established approaches that I simply haven't been able to find.
OKay, here in an answer, some R code - uses rgeos, sp:
For p = a single SpatialPolygon or single row of a SpatialPolygonsDataFrame:
where n=number of slices, returns n rectangular slice polygons. Now overlay:
should show you the slices. Now get the areas:
I'm just not sure how correct that will be if the polygons have holes in them. Try some tests first.