# I want to calculate how many buildings there are?

482
2
12-19-2019 01:11 PM
by
New Contributor III

Hi everyone,

I want to see automatically how many buildings are built in the parcel.I need to see this value as a number to use it in other operations. (reports,gfa,far calculations etc.) How can I do that?

This is my test rule and test result. In this case rule generated 5 building. Thank you...

@Hidden
attr length = 30
attr width = 30

Generate-->
split(x) { 25 : Garden | length : split(z) { 25: Garden | width:Building}*}*

Building-->
case geometry.area < length*width -5 : Garden
else :
extrude(30)

2 Replies
by
Occasional Contributor

You could simply report it but that's not really usable for aggregated internal calculations unless you do it with Python.

Here's one that calculates number of dwellings per hectare.

PS: I colour the bottom splits just for a visual check. Not that you can see it from this angle.

``````version "2019.1"

@Hidden
attr length = 30
attr width = 30

attr buildingNumber = 0
attr parcelArea = geometry.area

Generate-->
split(x) { 25 : Garden | length : split(z) { 25: Garden | width:Building}*}*

Building-->
case geometry.area < length*width -5 : Garden
else :
extrude(30)