Seeking Generalisation Strategies for Building Outlines in PostGIS?
There are many algorithms dedicated to building simplification. You may have a look at this website for an overview. See also this question. You could use:
- Building outline simplification: It consist in recursively deleting too short edges of the outline and lengthening the neighbor edges. Example:
- Smallest surrounding rectangle algorithm: It consist in replacing the building geometry by the smallest surrounding rectangle. This rectangle can also be scaled to the building initial area. Example:
- Squaring algorithm: It consists in applying a light rotation to edges to make the corners perfectly squared. Example:
These transformations may be enough for your need. It can be interesting to combine them.
I am almost 100% sure none of these algorithms are implemented in PostGIS. Some are implemented in the Opencarto java library I am developing. Let me know if you want to test it!
geometry ST_SimplifyPreserveTopology(geometry geomA, float tolerance);
Will avoid creating derived geometries (polygons in particular) that are invalid http://www.postgis.org/documentation/manual-1.5SVN/ST_SimplifyPreserveTopology.html
should be a better output than Simplify
check your geometry first and after
with ST_IsSimple(geometry geomA);
Something like this might do the trick:
"If we buffer by a large amount, then reverse the buffer by the same amount, we’ll get something that has a similar shape to the original, but without the crinkly bits."
http://blog.opengeo.org/2010/11/22/removing-complexities/