<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">---------- Forwarded message ---------<br>I have some ideas about how to calculate the intersections of tgeompoints with "temporal polygons" (!), that is, a polygon with a Period, and would like your opinion & advice.<br><br>Air traffic controllers vector aircraft away from their planned routes for various reasons.  If the original flight plan would have taken the flight through bad weather, then the controller had to vector the aircraft (that is, the vectoring/maneuvering away from the planned route wasn't because of traffic congestion).<br><br>I get raster weather radar data about storms every 15 minutes, and using GDAL's Polygonize(), convert radar levels above a threshold (30 dBz) into polygons.  I store those into PostGIS with a Period of "[now, next interval)".<br><br>Currently I make linestrings of the planned flight path and of the flown flight route through a particular airspace.  If they're about the same, then there is no issue.  If the flown flight path is much longer than the planned flight path, then the air traffic controller had to "work the aircraft", and it would be nice to know why that was.<br><br>Here's my idea:  make tgeompoint arrays of the planned flight path and somehow temporally intersect that with the various radar polygons over the course of the flight.  The flight may span several 15-minute intervals including several weather polygons, so I may have to union together all intersections to eliminate overlaps that would end up duplicating intersections.  The distance (or time) of the intersections would indicate the about of weather that the flight would have encountered if it had remained on its original planned flight path.<br><br>That way, when the airline asks "why was my aircraft late?", or the controller's supervisor asks "what were you doing all day?", the controller could answer "let me show you the scores calculated by Wendell's MobilityDB project."<br>---------- End forwarded message ---------<br><br>Dear Wendell<br><br>Here is an idea of how this can be solved. Please let me know if I understood correctly your message.<br><br>DROP TABLE IF EXISTS Storms;<br>CREATE TABLE Storms(storm, p) AS<br>SELECT geometry 'Polygon((10 10,12 10,12 12,10 12,10 10))', period '[2000-01-02, 2000-01-03)' UNION<br>SELECT geometry 'Polygon((12 12,16 12,16 16,12 16,12 12))', period '[2000-01-03, 2000-01-04)' UNION<br>SELECT geometry 'Polygon((14 14,16 14,16 16,14 16,14 14))', period '[2000-01-04, 2000-01-05)';<br><br>DROP TABLE IF EXISTS Flights;<br>CREATE TABLE Flights(flight) AS<br>SELECT tgeompoint '[Point(0 0)@2000-01-01, Point(20 20)@2000-01-06]';<br><br>SELECT asText(tintersects(atPeriod(flight, p), storm)) FROM Storms S, Flights F ORDER BY 1;<br>                                      astext<br>----------------------------------------------------------------------------------<br> [f@2000-01-02 00:00:00+01, f@2000-01-03 00:00:00+01)<br> {[f@2000-01-03 00:00:00+01, f@2000-01-04 00:00:00+01)}<br> {[f@2000-01-04 00:00:00+01, t@2000-01-04 12:00:00+01, t@2000-01-05 00:00:00+01)}<br>(3 rows)<br><br>Regards<br><br>Esteban<br><br></div><div><div dir="ltr"><div><div><div dir="ltr"><div dir="ltr">
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</div></div>