<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Landuses - Create a woodland - Random Tree Scatter in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-a-city-from-gis-data-landuses/m-p/45126#M621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A quick CGA rule share here!&amp;nbsp;&amp;nbsp; This one allows you to place randomly a selection of tree models on a lot (with start rule "woodland").&amp;nbsp;&amp;nbsp; In my city model I wanted to place some trees in open areas by a river so this was a quick solution.&amp;nbsp; 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need a tree you could use &lt;/SPAN&gt;&lt;A href="http://sketchup.google.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;SketchUp &lt;/A&gt;&lt;SPAN&gt;and if you have the free version &lt;/SPAN&gt;&lt;A href="http://forums.sketchucation.com/viewtopic.php?f=323&amp;amp;t=33448" rel="nofollow noopener noreferrer" target="_blank"&gt;you might want this OBJ exporter plugin &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
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

woodland--&amp;gt;
 setback(woodlandsetback) { streetSide : woodlandborder | remainder : trees} 
 
trees--&amp;gt; 
 scatter(surface, treenumber, uniform) { palmtree } 
 woodlandground


singletree--&amp;gt;
 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 
 i(tree_asset) 
 


woodlandborder--&amp;gt;
&amp;nbsp; extrude(1) woodlandbordercolor

woodlandground--&amp;gt;color("#005B00")


woodlandbordercolor--&amp;gt;color("#AAAA55") 

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;As usual if anyone has any suggestions/thoughts/modifications please reply!&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:44:58 GMT</pubDate>
    <dc:creator>ElliotHartley1</dc:creator>
    <dc:date>2021-12-10T21:44:58Z</dc:date>
    <item>
      <title>Creating a City from GIS data - Landuses</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-a-city-from-gis-data-landuses/m-p/45125#M620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://forums.arcgis.com/threads/51652-Creating-a-City-from-GIS-data-Transport-Infrastructure" rel="nofollow noopener noreferrer" target="_blank"&gt;Since my first post has produced such an amazing response &lt;/A&gt;&lt;SPAN&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I shall continue and start a thread on using GIS data on landuses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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 &lt;/SPAN&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;SPAN&gt; sub-divided.&amp;nbsp;&amp;nbsp; I then export these block shapes as a shapefile back into ArcGIS where I add new fields (&lt;/SPAN&gt;&lt;A href="http://www.planning.org/lbcs/standards/" rel="nofollow noopener noreferrer" target="_blank"&gt;like an LBCS or landuse Code&lt;/A&gt;&lt;SPAN&gt;).&amp;nbsp;&amp;nbsp; I can then make an outline landuse plan from these in ArcGIS and symbolise them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The layer attributes code would look like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
attr landuse = getObjectAttr("LBCS_Code")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then to colour the static shapes I could use the following code (don't forget to apply the rule file!):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
attr landuse = "0" // this just initialises the attribute that we have in our layer attributes

Lot--&amp;gt;&amp;nbsp; //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")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also see that I've used the report operation to produce a summary of the land areas (helpful when doing landuse plans!)&lt;/SPAN&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;So would anyone do this differently?&amp;nbsp; Thoughts/suggestions/corrections?&lt;BR /&gt;&lt;BR /&gt;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.&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:44:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-a-city-from-gis-data-landuses/m-p/45125#M620</guid>
      <dc:creator>ElliotHartley1</dc:creator>
      <dc:date>2021-12-10T21:44:56Z</dc:date>
    </item>
    <item>
      <title>Landuses - Create a woodland - Random Tree Scatter</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-a-city-from-gis-data-landuses/m-p/45126#M621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A quick CGA rule share here!&amp;nbsp;&amp;nbsp; This one allows you to place randomly a selection of tree models on a lot (with start rule "woodland").&amp;nbsp;&amp;nbsp; In my city model I wanted to place some trees in open areas by a river so this was a quick solution.&amp;nbsp; 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need a tree you could use &lt;/SPAN&gt;&lt;A href="http://sketchup.google.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;SketchUp &lt;/A&gt;&lt;SPAN&gt;and if you have the free version &lt;/SPAN&gt;&lt;A href="http://forums.sketchucation.com/viewtopic.php?f=323&amp;amp;t=33448" rel="nofollow noopener noreferrer" target="_blank"&gt;you might want this OBJ exporter plugin &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
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

woodland--&amp;gt;
 setback(woodlandsetback) { streetSide : woodlandborder | remainder : trees} 
 
trees--&amp;gt; 
 scatter(surface, treenumber, uniform) { palmtree } 
 woodlandground


singletree--&amp;gt;
 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 
 i(tree_asset) 
 


woodlandborder--&amp;gt;
&amp;nbsp; extrude(1) woodlandbordercolor

woodlandground--&amp;gt;color("#005B00")


woodlandbordercolor--&amp;gt;color("#AAAA55") 

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;As usual if anyone has any suggestions/thoughts/modifications please reply!&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:44:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-a-city-from-gis-data-landuses/m-p/45126#M621</guid>
      <dc:creator>ElliotHartley1</dc:creator>
      <dc:date>2021-12-10T21:44:58Z</dc:date>
    </item>
    <item>
      <title>Landuses - Area Test</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-a-city-from-gis-data-landuses/m-p/45127#M622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://forums.arcgis.com/threads/51940-Creating-a-City-from-GIS-data-Landuses" rel="nofollow noopener noreferrer" target="_blank"&gt;I've already outlined a way to allocate landuses based on a static shape layer&lt;/A&gt;&lt;SPAN&gt;, as we get nearer placing buildings on our plots we need to ensure that the "lots" are the correct size and shape.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This following rule can be adapted to test a Lot's area (in sqm) and then onto the next rule depending on its area.&amp;nbsp;&amp;nbsp; 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...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//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 &amp;lt; 100 : "100orLess"
 case geometry.area &amp;lt; 200 &amp;amp;&amp;amp; geometry.area &amp;gt; 100 : "100to200"
 case geometry.area &amp;lt; 300 &amp;amp;&amp;amp; geometry.area &amp;gt; 200 : "200to300"
 case geometry.area &amp;lt; 400 &amp;amp;&amp;amp; geometry.area &amp;gt; 300 : "300to400"
 case geometry.area &amp;lt; 500 &amp;amp;&amp;amp; geometry.area &amp;gt; 400 : "400to500"
 case geometry.area &amp;lt; 600 &amp;amp;&amp;amp; geometry.area &amp;gt; 500 : "500to600"
 case geometry.area &amp;lt; 700 &amp;amp;&amp;amp; geometry.area &amp;gt; 600 : "600to700"
 case geometry.area &amp;lt; 800 &amp;amp;&amp;amp; geometry.area &amp;gt; 700 : "700to800"
 case geometry.area &amp;lt; 900 &amp;amp;&amp;amp; geometry.area &amp;gt; 800 : "800to900"
 case geometry.area &amp;lt; 1000 &amp;amp;&amp;amp; geometry.area &amp;gt; 900 : "900to1000"
 case geometry.area &amp;gt; 1000 : "1000orMore"
 else : "0"


Lot--&amp;gt;
&amp;nbsp;&amp;nbsp; res_areatest




//this directs the rule to the appropriate model depending on the area size 
res_areatest--&amp;gt;
 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. 


res_100orless--&amp;gt;
 extrude(5) report("1000", geometry.area())
//etc....
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;As usual does anyone have any thoughts/suggestions/corrections? &lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:45:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-a-city-from-gis-data-landuses/m-p/45127#M622</guid>
      <dc:creator>ElliotHartley1</dc:creator>
      <dc:date>2021-12-10T21:45:01Z</dc:date>
    </item>
  </channel>
</rss>

