Tuesday, 2 October 2018

geometry - Seeking Generalisation Strategies for Building Outlines in PostGIS?


I have a dataset of building footprints vectorised from a raster dataset. The dataset is currently just a vector representation of the raster data. I would like a polygon dataset that only has vertices at the corners of the building. I have attempted to use the Simplify command in PostGIS with limited success.


Is there a better way?



Answer



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:


alt text



  • 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:


alt text



  • Squaring algorithm: It consists in applying a light rotation to edges to make the corners perfectly squared. Example:



alt text


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!


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...