Ok so this would actually work for Copenehagen, except it doesn�??t. But I think maybe that is because I suddenly forgot my math skills. What I need to do is to make every building with a shape area below 6000m2 and a MEAN_Z value below 21m to go thru the split functions. Everything building above 21m and 6000 m2 should make a flatroof.
* Author: KennethL
*/
version "2013.1"
@Location(-12,-117)
const MEAN_Z = 10
@Location(-12,-181)
attr taghaeldning = rand (15,25)
@Location(-13,-245)
const Shape_Area = 10
@Location(-8,-315)
const Test = 0.0
@Location(1974,-520)
X(h)-->
s('1,'h,'1)comp(f) { top : roof | side : facade}
@Location(527,-183)
Extrude --> extrude(world.y, MEAN_Z) Formel
@Location(845,-200)
Formel --> case MEAN_Z < 21 && Shape_Area < 6000 : splitter
else : Roofflat
@Location(1543,323)
Roofflat --> comp(f) { top : flatroof | side : facade} Shape
@Location(2600,17)
roof --> roofGable(22.5) Shape
@Location(1602,-533)
splitter --> split(z){ 20 : X(1) | ~50 : Y(1)}
@Location(1991,-132)
Y(h)-->
s('1,'h,'1) comp(f) { top : roof | side : facade}
@Location(2125,408)
flatroof --> roofGable(1) Shape
@Location(579,-287)