<?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: Generate hourly perimeters from daily data in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106593#M46584</link>
    <description>&lt;P&gt;Sorry, I find it hard to describe, as English isn't my first language. Hopefully the illustration helps...&lt;/P&gt;&lt;P&gt;Imagine you have location data over two days (red and blue points).&lt;/P&gt;&lt;P&gt;The first code sample will give you the polygons on the left side: one polygon for each time interval on each day. "Where were you on day 1, interval 2?"&lt;/P&gt;&lt;P&gt;The second code sample will give you the polygons on the right side: one polygon for each time interval on all observed days. "Where were you on any day, interval 2?"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1634017162234.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24997iD1B72B5767B47F99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1634017162234.png" alt="JohannesLindner_0-1634017162234.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 05:40:43 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2021-10-12T05:40:43Z</dc:date>
    <item>
      <title>Generate hourly perimeters from daily data</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106315#M46546</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have spatial-temporal point data. The point data represents locations at various times over the course of a couple of days. I would like to predict locations at fixed hourly intervals within a day (e.g every hour or every 4 hours) as polygons. All research has been leading back to the idea of using interpolation but I'm unsure of how to maneuver the tool for this purpose. Any recommendations on how to go about this?&lt;/P&gt;&lt;P&gt;Thanks for any input!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 04:32:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106315#M46546</guid>
      <dc:creator>RZara</dc:creator>
      <dc:date>2021-10-11T04:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Generate hourly perimeters from daily data</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106343#M46548</link>
      <description>&lt;P&gt;Couldn't you just use the convex hull of all points in the same interval?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import datetime
# variables
points_fc = "PointFC"
date_field = "DateField"
time_interval_minutes = 60
polygon_buffer = 100

# read shape and date
data = [r for r in arcpy.da.SearchCursor(points_fc, ["SHAPE@", date_field], sql_clause=(None, "ORDER BY " + date_field))]
# construct time bins
start_time = data[0][1]
end_time = data[-1][1]
time_bins = [start_time]
while time_bins[-1] &amp;lt; end_time:
    time_bins.append(time_bins[-1] + datetime.timedelta(minutes=time_interval_minutes))
# create output fc
sr = arcpy.Describe(points_fc).spatialReference
polygons = arcpy.management.CreateFeatureclass("memory", "polygons", "POLYGON", spatial_reference=sr)
arcpy.management.AddField(polygons, "StartTime", "DATE")
arcpy.management.AddField(polygons, "PointCount", "LONG")
# fill output fc
with arcpy.da.InsertCursor(polygons, ["SHAPE@", "StartTime", "PointCount"]) as cursor:
    for b in range(len(time_bins)-1):
        # get points that belong to the interval
        t0 = time_bins[b]
        t1 = time_bins[b+1]
        points = [d[0].firstPoint for d in data if d[1] &amp;gt;= t0 and d[1] &amp;lt; t1]
        # if there are points in the interval
        if points:
            # change list of point geometries to multipoint geometry
            multipoint = arcpy.Multipoint(arcpy.Array(points))
            # get the convex hull, buffer to prettify
            polygon = multipoint.convexHull().buffer(polygon_buffer)
            # insert
            cursor.insertRow([polygon, t0, len(points)])&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Oct 2021 08:27:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106343#M46548</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-10-11T08:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate hourly perimeters from daily data</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106350#M46550</link>
      <description>&lt;P&gt;I think I misunderstood your question...&lt;/P&gt;&lt;P&gt;The code above shows you the locations in a certain time interval. You want to know the probable locations in a time interval during a random day. Basic idea still applies:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from datetime import date, time, timedelta
# variables
points_fc = "PointFC"
date_field = "DateField"
time_interval_minutes = 60
polygon_buffer = 100

# read shape and date
data = [list(r) for r in arcpy.da.SearchCursor(points_fc, ["SHAPE@", date_field])]
for d in data:
    d.append(datetime.combine(date.today(), d[1].time()))
# construct time bins
start_time = datetime.combine(date.today(), time(0, 0))
end_time = start_time + timedelta(days=1)
time_bins = [start_time]
while time_bins[-1] &amp;lt; end_time:
    time_bins.append(time_bins[-1] + timedelta(minutes=time_interval_minutes))
# create output fc
sr = arcpy.Describe(points_fc).spatialReference
polygons = arcpy.management.CreateFeatureclass("memory", "polygons", "POLYGON", spatial_reference=sr)
arcpy.management.AddField(polygons, "StartTime", "TEXT")
arcpy.management.AddField(polygons, "PointCount", "LONG")
# fill output fc
with arcpy.da.InsertCursor(polygons, ["SHAPE@", "StartTime", "PointCount"]) as cursor:
    for b in range(len(time_bins)-1):
        # get points that belong to the interval
        t0 = time_bins[b]
        t1 = time_bins[b+1]
        points = [d[0].firstPoint for d in data if d[2] &amp;gt;= t0 and d[2] &amp;lt; t1]
        # if there are points in the interval
        if points:
            # change list of point geometries to multipoint geometry
            multipoint = arcpy.Multipoint(arcpy.Array(points))
            # get the convex hull, buffer to prettify
            polygon = multipoint.convexHull().buffer(polygon_buffer)
            # insert
            cursor.insertRow([polygon, t0.strftime("%H:%M"), len(points)])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 09:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106350#M46550</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-10-11T09:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Generate hourly perimeters from daily data</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106580#M46582</link>
      <description>&lt;P&gt;Johannes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for taking the time to assist. I understand that you described that the solution would generate polygons representing locations in a time interval during a random day. May you clarify if it could generate a feature class representing sub-daily time intervals from the daily data? I want to examine time intervals within the course of time that the data takes place (e.g. dataset took place over a 3-day time period and I want values for every 4 hours within those 3 days).&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 02:21:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106580#M46582</guid>
      <dc:creator>RZara</dc:creator>
      <dc:date>2021-10-12T02:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generate hourly perimeters from daily data</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106593#M46584</link>
      <description>&lt;P&gt;Sorry, I find it hard to describe, as English isn't my first language. Hopefully the illustration helps...&lt;/P&gt;&lt;P&gt;Imagine you have location data over two days (red and blue points).&lt;/P&gt;&lt;P&gt;The first code sample will give you the polygons on the left side: one polygon for each time interval on each day. "Where were you on day 1, interval 2?"&lt;/P&gt;&lt;P&gt;The second code sample will give you the polygons on the right side: one polygon for each time interval on all observed days. "Where were you on any day, interval 2?"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1634017162234.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24997iD1B72B5767B47F99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1634017162234.png" alt="JohannesLindner_0-1634017162234.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 05:40:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1106593#M46584</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-10-12T05:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Generate hourly perimeters from daily data</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1108572#M46864</link>
      <description>&lt;P&gt;The illustration was very helpful. I'll give it a try.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 20:16:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/generate-hourly-perimeters-from-daily-data/m-p/1108572#M46864</guid>
      <dc:creator>RZara</dc:creator>
      <dc:date>2021-10-18T20:16:17Z</dc:date>
    </item>
  </channel>
</rss>

