<?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 How to Test Whether A Lot is On a Corner in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574333#M7759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been using code like the extract below to test whether a lot is on a corner (i.e. has two streetwidth variables greater than 0).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better way to do this?&amp;nbsp; I know you can create LotCorners but these are triangular lots that I don't want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Lot --&amp;gt;
 setback(0.1) {streetSide: nil | remainder : test(comp.index)}

test(compIndex) --&amp;gt;
 case streetWidth(0) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(0) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(0) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 case streetWidth(1) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(1) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(1) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 case streetWidth(2) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(2) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(2) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 case streetWidth(3) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(3) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(3) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 else : nil

building--&amp;gt;
 offset(-2, inside)
 extrude(rand(3,15))
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Oct 2011 12:31:59 GMT</pubDate>
    <dc:creator>ElliotHartley1</dc:creator>
    <dc:date>2011-10-25T12:31:59Z</dc:date>
    <item>
      <title>How to Test Whether A Lot is On a Corner</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574333#M7759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been using code like the extract below to test whether a lot is on a corner (i.e. has two streetwidth variables greater than 0).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better way to do this?&amp;nbsp; I know you can create LotCorners but these are triangular lots that I don't want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Lot --&amp;gt;
 setback(0.1) {streetSide: nil | remainder : test(comp.index)}

test(compIndex) --&amp;gt;
 case streetWidth(0) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(0) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(0) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 case streetWidth(1) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(1) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(1) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 case streetWidth(2) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(2) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(2) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 case streetWidth(3) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(1) &amp;gt; 0 : building
 case streetWidth(3) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(2) &amp;gt; 0 : building
 case streetWidth(3) &amp;gt; 0 &amp;amp;&amp;amp; streetWidth(3) &amp;gt; 0 : building
 else : nil

building--&amp;gt;
 offset(-2, inside)
 extrude(rand(3,15))
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 12:31:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574333#M7759</guid>
      <dc:creator>ElliotHartley1</dc:creator>
      <dc:date>2011-10-25T12:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to test whether a lot is on a corner?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574334#M7760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi .. you're using the component index, that's not so good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd try and create a recursion with geometry.nVertices. like this, you could be independent of the actual number of edges per Lot.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 16:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574334#M7760</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2011-10-27T16:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to test whether a lot is on a corner?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574335#M7761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Like so :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
attr streetWidth(i) =&amp;nbsp; 0


LotInner --&amp;gt; NIL

Lot --&amp;gt;
 CornerRecursion(geometry.nVertices - 1, 0)
 

CornerRecursion ( edgeID, nStreetEdges ) --&amp;gt;
 case edgeID &amp;gt;= 0 :
&amp;nbsp; case streetWidth(edgeID) &amp;gt; 0 :
&amp;nbsp;&amp;nbsp; #print (edgeID)
&amp;nbsp;&amp;nbsp; CornerRecursion ( edgeID - 1, nStreetEdges + 1 )
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp; #print (edgeID)
&amp;nbsp;&amp;nbsp; CornerRecursion ( edgeID - 1, nStreetEdges )&amp;nbsp;&amp;nbsp; 
 else:
&amp;nbsp; case nStreetEdges &amp;gt;= 2 :
&amp;nbsp;&amp;nbsp; IsCornerLot
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp; IsNotCornerLot


IsCornerLot --&amp;gt;
 color("#ff0000")

IsNotCornerLot --&amp;gt;
 color("#00ff00")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ok ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:43:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574335#M7761</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-12T00:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to test whether a lot is on a corner?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574336#M7762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;see screenshot for a result.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 17:07:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574336#M7762</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2011-10-27T17:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to test whether a lot is on a corner?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574337#M7763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's fantastic, thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 11:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574337#M7763</guid>
      <dc:creator>ElliotHartley1</dc:creator>
      <dc:date>2011-10-28T11:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to test whether a lot is on a corner?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574338#M7764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;sure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the idea itself was actually interesting to wrap in code. I've never thought so far about that corner lots themselves should be isolated, but obviously it makes sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it's been good homework.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 15:16:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574338#M7764</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2011-10-28T15:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to Test Whether A Lot is On a Corner</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574339#M7765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! I know a lot of time has passed since this original thread was created, but I'm really struggling with&amp;nbsp;the solution above. The solution is completely logical, and I can follow what the code is intending to do just fine. The only problem is...the streetWidths returned on any lot I run the code on just return 0! I'm missing something, but I'm not sure what. The streetwidth values are there in the Object Attributes in the Inspector when I select the lot, so why isn't the code returning them?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone out there help, because this is driving me crazy!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Sep 2019 11:23:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574339#M7765</guid>
      <dc:creator>JackCurran</dc:creator>
      <dc:date>2019-09-01T11:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Test Whether A Lot is On a Corner</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574340#M7766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The rule works for me if I apply it to dynamic lot shapes generated inside street blocks.&amp;nbsp; Can you be more specific about the problem?&amp;nbsp; Do you see the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;streetWidth&lt;/SPAN&gt; attr as a rule attribute in the Inspector?&amp;nbsp; Does rule attribute's value match the value&amp;nbsp;of the object attribute &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;streetWidth&lt;/SPAN&gt;?&amp;nbsp; What is the exact code that returns 0?&amp;nbsp; What prints if you insert &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;print(streetWidth(0))&lt;/SPAN&gt;&amp;nbsp;as the first line of the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Lot&lt;/SPAN&gt; rule?&amp;nbsp; What is your input shape?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2019 11:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574340#M7766</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2019-09-02T11:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Test Whether A Lot is On a Corner</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574341#M7767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that the rule only counts whether the lot has two or more edges that border a street.&amp;nbsp; This means that it won't work in some cases such as when a lot borders streets on two opposite sides but isn't a corner lot.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/458377_corner_lot_detection_failed.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2019 12:45:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574341#M7767</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2019-09-02T12:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Test Whether A Lot is On a Corner</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574342#M7768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm...I am revisiting this now and, inexplicably, the streetWidth attributes are now being picked up. I'm not sure whether it is a system reboot, the update to CityEngine 2019 I performed or (let's be honest) some kind of user error, but at least the attributes are now coming through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately, it doesn't look as though it's going to be of use to me, as the streets in my scene&amp;nbsp;can be quite curvy, so any corresponding lot incorrectly gets picked up as a corner lot (as shown below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank so much for your help though!&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/458899_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2019 15:15:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-test-whether-a-lot-is-on-a-corner/m-p/574342#M7768</guid>
      <dc:creator>JackCurran</dc:creator>
      <dc:date>2019-09-06T15:15:16Z</dc:date>
    </item>
  </channel>
</rss>

