Classify building footprints

I have been adding more built-in attributes to scenProc recently, to allow you to classify buidling footprints in different types. Then for each type you can make different kind of autogen. This work is not yet finished, but in this blog post I want to show what you can do already now.

Please read the scenProc manual to see which attributes are available and what they mean. Below is a scenProc configuration file I used to create autogen around the city of Amsterdam:

# Amsterdam autogen test
IMPORTSHP|buildings_adam.shp|NOREPROJ
#
ADDATTRIBUTE|*|BUILDCAT|5|1
ADDATTRIBUTE|FCONVEX=1|BUILDCAT|4|1
ADDATTRIBUTE|FNUMPERPANG>3;FNUMNOTPAR<2;FNUMVERT<10|BUILDCAT|3|1
ADDATTRIBUTE|FAREARAT>0.85|BUILDCAT|2|1
ADDATTRIBUTE|FNUMVERT=4;FNUMPERPANG=4|BUILDCAT|1|1
#
EXPORTSHP|*|bla
#
SPLITGRID|AGN
#
SETAGNBUILDINGHEIGHT|1.0;0.4;0.2;0.0
CREATEAGNGENBUILD|BUILDCAT<2;FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CREATEAGNGENBUILD|BUILDCAT<2;FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}
#
WRITEAGNFILES|c:flightsimnl2000nl2k_v4_resample_NHtexture

Let me explain what is done here. First I import the shapefiles that I want to use. Next I use the (new) ADDATTRIBUTE step to calculate some new custom attribute. This is where most of the work to classify the buildings happens. I have defined the following categories for my buildings:
  1. Rectangular
  2. Nearly rectangular
  3. Can be represented by a number of rectangles
  4. Convex polygons
  5. Concave polygons

So first I set all features to category 5. Then with the second ADDATTRIBUTE step is make sure all convex buildings are category 4. The FCONVEX attribute is used for this. All buildings that have at least 4 perpendicular corners and no more than 2 edges that don’t have another parallel edge and have less than 10 vertices are step to category 3. All buildings where the difference between the footprint area and the bounding box area less than 15% are set to category 2. And finally all footprints with 4 perpendicular corners are defined as rectangle (category 1).

Now I use can this new attribute BUILDCAT to create the autogen buidlings. I use category 1 and 2 for the rectangular autogen. The other three categories are not used in this example. But my plan is to add another step that can split the footprints of category 3 into a couple of rectangles to represent the shape. For category 4 and 5 maybe the polygonal autogen can be used or else I think it would be a good idea to create MDL objects from those footprints.

Of course the classification I show now is not how it should be done, you are free to define your own rules in the ADDATTRIBUTE steps. Let me know if more attributes are needed for that.

Below is a screenshot that shows which footprints are classified in which category for part of the city. As you can see it is not perfect yet, so I will continue to do some more testing to refine my rules. Once I found a set that works well, I’ll post an update of course. Especially for category 3 the results as not as good as I hoped, so I will try to find a better algorithm there.

 

5 thoughts on “Classify building footprints

  1. Andy Ford says:

    Sounds great Arno!

    Always good to see Flight Sim developers using QGIS too! 😉

  2. Markus says:

    very interesting stuff. Hope you’ll find a way for creating the autogen for 4 & 5 – which surely a big challenge. Good luck!

  3. Foxone says:

    Super, you are best development in world FS, full with courage for the continuation and of the success, does not forget to tan a little!!

  4. Vogel69 says:

    Hi Arno and Thx for your amazing hard work!

    I’m new in FS editing world but I would to ask if you can add the “NAME” property in the ATTRIBUTE because I try to class my polygons with this property which I change from “NULL” to “HOUSE” or “SHOP” or “FOREST” or other category directly in QGIS. I think it would be usefull to sort polygons with the “NAME” or a equivalent attribute… thx

  5. arno says:

    Hi,

    If there is a name attribute in the data you load, then it can be used in scenproc as well. Just be aware it is case sensitive.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.