determining time in hotspots with the help of fme
TRANSCRIPT
![Page 1: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/1.jpg)
Time in Hotspot
Brett Lord-CastilloGIS ProgrammerSt Louis County Emergency Management
April 10th, 2013
![Page 2: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/2.jpg)
A simple problem
Given a set of designated crime “Hotspots” Find out how much time police vehicles spend in those hotspots Which hotspots? Which days? What hours? Which cars?
![Page 3: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/3.jpg)
The data
Automatic Vehicle Location (AVL) Car ID Latitude/Longitude Timestamp
Every 30 seconds per vehicle Hundreds of thousands of records per day
![Page 4: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/4.jpg)
The data-complications
No specific order Transmitters malfunction (and we lose a car) Receiver malfunctions (and we lose hours) 5 minute stopped = stops transmitting
(But GPS Drift can bring it back on) Thirty seconds is rarely thirty seconds New dataset every day
(And sometimes we even lose a day)
![Page 5: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/5.jpg)
Manual method
Convert Latitude/Longitude to XY Point table Select by Location with Hotspots polygons
Export and sum up number of returns Assume each return is 30 seconds
-or- Manually assign times to each point Sum up time on all returns
![Page 6: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/6.jpg)
Why manual doesn’t work
Very time consuming, especially with manually assigned times
Have to redo selections for each dimension By Hotspot By Car By Day of Week By Time of Day
![Page 7: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/7.jpg)
The Workspace
![Page 8: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/8.jpg)
Not as complicated as it looks
![Page 9: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/9.jpg)
Initialize and collect recordswith a blocking transformer
![Page 10: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/10.jpg)
Inside the Loop: Three Date Formats
Day of the Week: String created by format %a (Name of day of week)Hour of Day: Number created by format %H (24-hour hour of day)epoch: Number created by format %s (seconds since epoch)_totaltime: Placeholder to assign time for each GPS return
![Page 11: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/11.jpg)
Get some more information
fme_feature_type: Keep track of which points are from this week_prevcar: Car ID from the last feature processed
(We store this later)
![Page 12: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/12.jpg)
Assign the time this return is worth
![Page 13: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/13.jpg)
Set aside info for next feature
![Page 14: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/14.jpg)
Spatial FilterSelect by Location, Spatial Join,and Blocking Transformer all in one
![Page 15: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/15.jpg)
Output: Save Our Work(With fanout writer)
Week1019_1025 Pings1019_1025
![Page 16: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/16.jpg)
Points for analysisAnd one sheet in an Excel Workbook
![Page 17: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/17.jpg)
Last two sheets in the workbook
![Page 18: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/18.jpg)
Outcomes
![Page 19: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/19.jpg)
Comparison
First manual attempt took over 4 hours (To process one day) And assumed one point = 30 seconds Single stat (total time by hotspot)
FME ran entire week in under 30 minutes Automated Less assumptions More dimensions (By Car, By Day, By Hour)
![Page 20: Determining Time in Hotspots with the Help of FME](https://reader035.vdocuments.us/reader035/viewer/2022081519/55934eee1a28ab383c8b46ea/html5/thumbnails/20.jpg)
Thank You!
Questions?
For more information: Brett Lord-Castillo, [email protected]
St Louis County Emergency Management
@blordcastillo https://github.com/marigolds6