<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hello </span>Masanao Yajima,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>for db-design you can go with ogr2ogr (GPX -> PostGIS). Ogr2ogr
creates point and line geometrys from gpx files. In case of linestring you have
to add the 4. Dimension from the point table.<o:p></o:p></p>
<p class=MsoNormal>A optimal query would be the intersection from gps-linestrings
and your polygon area. The result can be many sublinestrings with start and end
time.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Gr Ralf<o:p></o:p></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <b>Im Auftrag von </b>Masanao
Yajima<br>
<b>Gesendet:</b> Montag, 5. Oktober 2009 23:03<br>
<b>An:</b> postgis-users@postgis.refractions.net<br>
<b>Betreff:</b> [postgis-users] PostGIS to calculate time spent within polygon<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Dear PostGIS users<br>
<br>
I am new to PostGIS and I would like expert opinion on how to deal with my
situation.<br>
<br>
I have 2D GPS data and time associated with each points and they represents
line of a trip.<br>
I also have few geographic polygon data representing some area on a map.<br>
<br>
what I want to get out is length of time that is spent within polygon area for
a trip.<br>
<br>
What is the optimal way to design a database and what kind of query would you
use to get such a number.<br>
<br>
One constraint is the time interval for GPS is not accurate so sampling rate
vary alot with in a trip.<br>
<br>
I thought of using time as 4th dimension but I believe st_intersection is not
implemented on the 4th dimension..<br>
<br>
I could do this by bruit force but I am looking for something fast.<br>
<br>
I appreciate your help.<br clear=all>
<br>
-- <br>
Masanao Yajima<o:p></o:p></p>
</div>
</body>
</html>