+ Reply to Thread
Results 1 to 3 of 3

Thread: Creating a City from GIS data - Landuses

  1. #1
    Elliot Hartley
    Join Date
    Oct 2011
    Answers Provided


    Default Creating a City from GIS data - Landuses

    Since my first post has produced such an amazing response I shall continue and start a thread on using GIS data on landuses.

    What I have been doing is using my road network in ArcGIS and importing it into CityEngine where I make a suitable road network, this I use to create blocks that are not sub-divided. I then export these block shapes as a shapefile back into ArcGIS where I add new fields (like an LBCS or landuse Code). I can then make an outline landuse plan from these in ArcGIS and symbolise them.

    So we start back again in CityEngine with some static shapes with an object attribute for the landuse (in my case I've called it LBCSCode).

    The layer attributes code would look like this :
    attr landuse = getObjectAttr("LBCS_Code")
    Then to colour the static shapes I could use the following code (don't forget to apply the rule file!):

    attr landuse = "0" // this just initialises the attribute that we have in our layer attributes
    Lot-->  //I didn't use LotInner as this example doesn't create a subdivision
    	case landuse == "1000" : color("#FFFF00") report("1000", geometry.area())
    	case landuse == "2000" : color("#FF0000") report("2000", geometry.area())
    	case landuse == "3000" : color("#A020F0") report("3000", geometry.area())
    	case landuse == "4000" : color("#0000FF") report("4000", geometry.area())
    	case landuse == "5000" : color("#BEBEBE") report("5000", geometry.area())
    	case landuse == "6000" : color("#2F4F4F") report("6000", geometry.area())
    	case landuse == "7000" : color("#90EE90") report("7000", geometry.area())
    	case landuse == "8000" : color("#228B22") report("8000", geometry.area())
    	case landuse == "9000" : color("#FFFFFF") report("9000", geometry.area())
    	else : color("#000000")
    You can also see that I've used the report operation to produce a summary of the land areas (helpful when doing landuse plans!)

    So would anyone do this differently? Thoughts/suggestions/corrections?

    The next post will cover using this static shape layer to inform a dynamic model so change landuses in the object attributes here will change what happens in the dynamic model.

  2. #2
    Elliot Hartley
    Join Date
    Oct 2011
    Answers Provided


    Lightbulb Landuses - Create a woodland - Random Tree Scatter

    A quick CGA rule share here! This one allows you to place randomly a selection of tree models on a lot (with start rule "woodland"). In my city model I wanted to place some trees in open areas by a river so this was a quick solution. This places a number of random trees (100) of different sizes and ranges, I've also allowed for a setback so when the lot fronts a road the trees are not right up against it.

    Obviously you can change the names of the rules to what you use and you could combine this with the landuses code I posted first in this discussion thread.

    If you need a tree you could use SketchUp and if you have the free version you might want this OBJ exporter plugin

    tree_asset = fileRandom("trees/tree*.obj") // you could just have *.obj and it would randomly pick any obj file in this directory, you can use sketchup to create an obj
    attr treenumber = 100 //change this depending on your lot size, or maybe run an area test on the lot to determine the density of your woodland!
    attr treeminheight = 5 // know your tree to get that realistic height, perhaps wiki it?
    attr treemaxheight = 15
    attr woodlandsetback = 5
    	setback(woodlandsetback) { streetSide : woodlandborder | remainder : trees} 
    	scatter(surface, treenumber, uniform) { palmtree } 
    	t(0,0,0) // you can change these numbers as well if you didn't want to place the tree at the scatter point centre
    	s(0,rand(treeminheight ,treemaxheight ),0)
    	r(0,rand(0,360),0) // rotates tree at a random rotation 
    	 extrude(1) woodlandbordercolor
    As usual if anyone has any suggestions/thoughts/modifications please reply!

  3. #3
    Elliot Hartley
    Join Date
    Oct 2011
    Answers Provided


    Lightbulb Landuses - Area Test

    I've already outlined a way to allocate landuses based on a static shape layer, as we get nearer placing buildings on our plots we need to ensure that the "lots" are the correct size and shape.

    This following rule can be adapted to test a Lot's area (in sqm) and then onto the next rule depending on its area. I've used this to place different building types on a lot depending on it's area but you could just as easily tie this into the woodland rule set above...

    //the descriptive names can be changed and are more of a guide really change or add more areas for your needs
    attr areatest = 
    	case geometry.area < 100 : "100orLess"
    	case geometry.area < 200 && geometry.area > 100 : "100to200"
    	case geometry.area < 300 && geometry.area > 200 : "200to300"
    	case geometry.area < 400 && geometry.area > 300 : "300to400"
    	case geometry.area < 500 && geometry.area > 400 : "400to500"
    	case geometry.area < 600 && geometry.area > 500 : "500to600"
    	case geometry.area < 700 && geometry.area > 600 : "600to700"
    	case geometry.area < 800 && geometry.area > 700 : "700to800"
    	case geometry.area < 900 && geometry.area > 800 : "800to900"
    	case geometry.area < 1000 && geometry.area > 900 : "900to1000"
    	case geometry.area > 1000 : "1000orMore"
    	else : "0"
    //this directs the rule to the appropriate model depending on the area size 
    	case areatest == "100orless" : res_100orless
    	case areatest == "100to200" : res_100to200
    	case areatest == "200to300" : res_200to300
    	case areatest == "400to500" : res_400to500
    	case areatest == "500to600" : res_500to600
    	case areatest == "600to700" : res_600to700
    	case areatest == "700to800" : res_700to800
    	case areatest == "800to900" : res_800to900
    	case areatest == "900to1000" : res_900to1000
    	case areatest == "1000orMore" : res_1000orMore
    	else : stop.	
    	extrude(5) report("1000", geometry.area())

    As usual does anyone have any thoughts/suggestions/corrections?

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts