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:
- Rectangular
- Nearly rectangular
- Can be represented by a number of rectangles
- Convex polygons
- 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.