<?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: winddirection in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/winddirection/m-p/1160737#M53583</link>
    <description>&lt;P&gt;Hmmm... My first instinct would be to create an elliptical buffer, with the feature being in the ellipsis focal point that is pointed into the wind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def elliptic_buffer(in_features, id_field, major, minor, azimuth, out_features):
    """Creates an alliptic buffer around the input features.

    in_features: input feature class / layer
    id_field: name of a unique id field in the in_features
    major: buffer distance in the major elliptical axis (meters)
    minor: buffer distance in the minor elliptical axis (meters)
    azimuth: geographic angle of the buffer (degrees, North = 0°, East = 90°)
    out_features: output feature class
    
    """
    arcpy.env.addOutputsToMap = False
    # read shapes and id
    shapes = [row for row in arcpy.da.SearchCursor(in_features, ["SHAPE@", id_field])]
    sr = shapes[0][0].spatialReference
    # create ellipsis parameters
    ellipsis_table = arcpy.management.CreateTable("memory", "ellipsis_table")
    fields = ["X", "Y", "MAJOR", "MINOR", "AZIMUTH", "ID"]
    for f in fields:
        arcpy.management.AddField(ellipsis_table, f, "DOUBLE")
    with arcpy.da.InsertCursor(ellipsis_table, fields) as cursor:
        for shape, id in shapes:
            densified_shape = shape.densify("DISTANCE", 10, 10)
            for part in densified_shape:
                for point in part:
                    cursor.insertRow([point.X, point.Y, major, minor, azimuth, id])
    # create ellipsis for each point of each densified feature (polyline)
    ellipsis_fc = arcpy.management.TableToEllipse(ellipsis_table, "memory/ellipsis_fc", "X", "Y", "MAJOR", "MINOR", "METERS", "AZIMUTH", "DEGREES", "ID", sr)
    # translate features, so that each determining point is in the focal point pointed into the wind
    dist = (major**2 - minor**2)**(0.5)
    dx = dist * math.sin(azimuth * math.pi / 180) / 2
    dy = dist * math.cos(azimuth * math.pi / 180) / 2
    with arcpy.da.UpdateCursor(ellipsis_fc, ["SHAPE@XY"]) as cursor:
        for row in cursor:
            cursor.updateRow([[row[0][0] - dx, row[0][1] - dy]])
    # create output fc
    arcpy.env.addOutputsToMap = True  # add out_features to map
    out_fc = arcpy.management.CreateFeatureclass(os.path.dirname(out_features), os.path.basename(out_features), "POLYGON", spatial_reference=sr)
    id_type = [f.type for f in arcpy.ListFields(in_features) if f.name == id_field][0]
    if id_type == "OID":
        id_field = "FID"
        id_type = "LONG"
    arcpy.management.AddField(out_fc, id_field, id_type)
    # convert ellipses to polygon (FeatureToPolygon doesn't keep the id_field...)
    ellipses = [row for row in arcpy.da.SearchCursor(ellipsis_fc, ["ID", "SHAPE@"])]
    ids = {e[0] for e in ellipses}
    with arcpy.da.InsertCursor(out_fc, ["SHAPE@", id_field]) as i_cursor:
        for id in ids:
            polylines = [e[1] for e in ellipses if e[0] == id]
            polygon = polylines[0].convexHull()
            for polyline in polylines:
                polygon = polygon.union(polyline.convexHull())
            i_cursor.insertRow([polygon, id])



elliptic_buffer("TestPolygons", "OBJECTID", 1000, 500, 45, "memory/test")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are example buffers for a wind from the north east (azimuth = 45°):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1649079785478.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38076i4955F2FCE7EBE1A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1649079785478.png" alt="JohannesLindner_0-1649079785478.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using appropriate major and minor distances according to wind speed would then be a problem of experience or calibration. Generally speaking:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;low wind speed: major and minor distance are similar and relatively small&lt;/LI&gt;&lt;LI&gt;high wind speed: major distance is much greater that minor distance&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: For ArcMap, you have to replace all &lt;STRONG&gt;"memory"&lt;/STRONG&gt; instances with &lt;STRONG&gt;"in_memory"&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 13:59:10 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-04-04T13:59:10Z</dc:date>
    <item>
      <title>winddirection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/winddirection/m-p/1160688#M53573</link>
      <description>&lt;P&gt;Does anyone have a suggestion how to create a buffer around a polygon based on windspeed and winddirection? The normal geoprocessing tool 'buffer' is mainly based on distances and thereby creating circles. A want to use these bufferpolygons as riskzones for example atmospheric deposition or as a riskzone during a major fire. I am using arcgis desktop 10.8.1&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 10:11:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/winddirection/m-p/1160688#M53573</guid>
      <dc:creator>AnitaBuschgens</dc:creator>
      <dc:date>2022-04-04T10:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: winddirection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/winddirection/m-p/1160737#M53583</link>
      <description>&lt;P&gt;Hmmm... My first instinct would be to create an elliptical buffer, with the feature being in the ellipsis focal point that is pointed into the wind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def elliptic_buffer(in_features, id_field, major, minor, azimuth, out_features):
    """Creates an alliptic buffer around the input features.

    in_features: input feature class / layer
    id_field: name of a unique id field in the in_features
    major: buffer distance in the major elliptical axis (meters)
    minor: buffer distance in the minor elliptical axis (meters)
    azimuth: geographic angle of the buffer (degrees, North = 0°, East = 90°)
    out_features: output feature class
    
    """
    arcpy.env.addOutputsToMap = False
    # read shapes and id
    shapes = [row for row in arcpy.da.SearchCursor(in_features, ["SHAPE@", id_field])]
    sr = shapes[0][0].spatialReference
    # create ellipsis parameters
    ellipsis_table = arcpy.management.CreateTable("memory", "ellipsis_table")
    fields = ["X", "Y", "MAJOR", "MINOR", "AZIMUTH", "ID"]
    for f in fields:
        arcpy.management.AddField(ellipsis_table, f, "DOUBLE")
    with arcpy.da.InsertCursor(ellipsis_table, fields) as cursor:
        for shape, id in shapes:
            densified_shape = shape.densify("DISTANCE", 10, 10)
            for part in densified_shape:
                for point in part:
                    cursor.insertRow([point.X, point.Y, major, minor, azimuth, id])
    # create ellipsis for each point of each densified feature (polyline)
    ellipsis_fc = arcpy.management.TableToEllipse(ellipsis_table, "memory/ellipsis_fc", "X", "Y", "MAJOR", "MINOR", "METERS", "AZIMUTH", "DEGREES", "ID", sr)
    # translate features, so that each determining point is in the focal point pointed into the wind
    dist = (major**2 - minor**2)**(0.5)
    dx = dist * math.sin(azimuth * math.pi / 180) / 2
    dy = dist * math.cos(azimuth * math.pi / 180) / 2
    with arcpy.da.UpdateCursor(ellipsis_fc, ["SHAPE@XY"]) as cursor:
        for row in cursor:
            cursor.updateRow([[row[0][0] - dx, row[0][1] - dy]])
    # create output fc
    arcpy.env.addOutputsToMap = True  # add out_features to map
    out_fc = arcpy.management.CreateFeatureclass(os.path.dirname(out_features), os.path.basename(out_features), "POLYGON", spatial_reference=sr)
    id_type = [f.type for f in arcpy.ListFields(in_features) if f.name == id_field][0]
    if id_type == "OID":
        id_field = "FID"
        id_type = "LONG"
    arcpy.management.AddField(out_fc, id_field, id_type)
    # convert ellipses to polygon (FeatureToPolygon doesn't keep the id_field...)
    ellipses = [row for row in arcpy.da.SearchCursor(ellipsis_fc, ["ID", "SHAPE@"])]
    ids = {e[0] for e in ellipses}
    with arcpy.da.InsertCursor(out_fc, ["SHAPE@", id_field]) as i_cursor:
        for id in ids:
            polylines = [e[1] for e in ellipses if e[0] == id]
            polygon = polylines[0].convexHull()
            for polyline in polylines:
                polygon = polygon.union(polyline.convexHull())
            i_cursor.insertRow([polygon, id])



elliptic_buffer("TestPolygons", "OBJECTID", 1000, 500, 45, "memory/test")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are example buffers for a wind from the north east (azimuth = 45°):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1649079785478.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38076i4955F2FCE7EBE1A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1649079785478.png" alt="JohannesLindner_0-1649079785478.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using appropriate major and minor distances according to wind speed would then be a problem of experience or calibration. Generally speaking:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;low wind speed: major and minor distance are similar and relatively small&lt;/LI&gt;&lt;LI&gt;high wind speed: major distance is much greater that minor distance&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: For ArcMap, you have to replace all &lt;STRONG&gt;"memory"&lt;/STRONG&gt; instances with &lt;STRONG&gt;"in_memory"&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 13:59:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/winddirection/m-p/1160737#M53583</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-04-04T13:59:10Z</dc:date>
    </item>
  </channel>
</rss>

