<?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 Re: How to evaluate the world orientation of building footprints in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1008416#M10073</link>
    <description>&lt;P&gt;you can use two array functions with&amp;nbsp;&lt;SPAN&gt;comp.sel&lt;/SPAN&gt; to detect the street frontage and another one to detect world orientation, so if the side is a street front and it is face east or west then it's on a N/S street, or if its facing north or south then it's on a W/E street,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry cant do up the codes, dont have a personal CE license, n at work's too busy to do it.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 11:29:30 GMT</pubDate>
    <dc:creator>Kevin_Z</dc:creator>
    <dc:date>2020-12-10T11:29:30Z</dc:date>
    <item>
      <title>How to evaluate the world orientation of building footprints</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1007173#M10066</link>
      <description>&lt;P&gt;In a block with offset subdivision, I need to evaluate whether a lot sits on an East-West or North-South oriented street or – alternatively – whether the long edge of a sub shape is oriented East-West or North-South.&lt;/P&gt;&lt;P&gt;Is there a simple way to do that?&lt;/P&gt;&lt;P&gt;I have been researching the convert and comp functions as well as the&amp;nbsp;&lt;SPAN&gt;geometry.isOriented and the&amp;nbsp;geometry.angle functions. The former two I can't get my head around and the latter two only work on non-horizontal shapes.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;As I need to evaluate the orientation before I extrude the building envelopes, I find myself in a bit of a catch-22.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;Nic&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Image: Building footprints colored according to their world orientation with their long edge oriented either&amp;nbsp;East-West (red) or North-South (blue)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="building orientation.png" style="width: 200px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/1549i4CEAF36C60D23F89/image-size/small?v=v2&amp;amp;px=200" role="button" title="building orientation.png" alt="building orientation.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 17:41:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1007173#M10066</guid>
      <dc:creator>NicolaiSteinø</dc:creator>
      <dc:date>2020-12-05T17:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate the world orientation of building footprints</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1007314#M10068</link>
      <description>&lt;P&gt;In Python:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def get_orientation(shape):
    """Returns a string describing the orientation ('NS', 'EW', or 'SQUARE') of the given feature geometry."""
    extent = shape.extent
    len_x = extent.XMax - extent.XMin
    len_y = extent.YMax - extent.YMin
    if len_x &amp;gt; len_y:
        return 'EW'
    if len_y &amp;gt; len_x:
        return 'NS'
    return 'SQUARE'

# do something with these values (e.g. calculate a field)
with arcpy.da.UpdateCursor(feature_class, ["SHAPE@", "Orientation"]) as cursor:
    for shape, orientation in cursor:
        orientation = get_orientation(shape)
        cursor.updateRow([shape, orientation])
        &lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Dec 2020 11:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1007314#M10068</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2020-12-07T11:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate the world orientation of building footprints</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1008009#M10070</link>
      <description>&lt;P&gt;Hi, thanks for the answer, yet as I understand it (I’m an architect, not a programmer) python rutines need to be activated manually and cannot be evoked by a cga script. Correct?&lt;/P&gt;&lt;P&gt;In that case, this solution is of little help to me, as I might as well check it manually/visually as to run a python script. What I need is for my cga script to be able to do the evaluation. Any chance of that?&lt;/P&gt;&lt;P&gt;(While I am quite fluent in cga, I have no clue of python.)&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Nic&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 11:54:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1008009#M10070</guid>
      <dc:creator>NicolaiSteinø</dc:creator>
      <dc:date>2020-12-09T11:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate the world orientation of building footprints</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1008013#M10071</link>
      <description>&lt;P&gt;Ah, I didn't realize this was posted in the CityEngine group...&lt;/P&gt;&lt;P&gt;While I'm quite fluent in python, I have no clue of cga &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Yeah, you'd have to manually start the python script. If that doesn't work for you, you could try out&amp;nbsp;Attribute Rules (assuming you have an Enterprise or File Geodatabase with your data).&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/de/pro-app/help/data/geodatabases/overview/an-overview-of-attribute-rules.htm" target="_blank" rel="noopener"&gt;Overview of Attribute Rules&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a calculation rule that triggers on insert and update with the following Arcade code (same concept&amp;nbsp;as the python code above):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var e = Extent(Geometry($feature))
var len_x = e.xmax - e.xmin
var len_y = e.ymax - e.ymin 
return When(len_x &amp;gt; len_y, 'EW', len_y &amp;gt; len_x, 'NS', 'SQUARE')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 12:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1008013#M10071</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2020-12-09T12:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate the world orientation of building footprints</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1008416#M10073</link>
      <description>&lt;P&gt;you can use two array functions with&amp;nbsp;&lt;SPAN&gt;comp.sel&lt;/SPAN&gt; to detect the street frontage and another one to detect world orientation, so if the side is a street front and it is face east or west then it's on a N/S street, or if its facing north or south then it's on a W/E street,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry cant do up the codes, dont have a personal CE license, n at work's too busy to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-evaluate-the-world-orientation-of-building/m-p/1008416#M10073</guid>
      <dc:creator>Kevin_Z</dc:creator>
      <dc:date>2020-12-10T11:29:30Z</dc:date>
    </item>
  </channel>
</rss>

