<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=687071621-22062008><FONT face=Arial
color=#0000ff size=2>Joe,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687071621-22062008><FONT face=Arial
color=#0000ff size=2>You need to convert to some sort of foot or meter
projection that is suitable for your area of interest. your measures are
in degrees.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687071621-22062008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=687071621-22062008><FONT face=Arial
color=#0000ff size=2>Then once you've figured out the SRID of that - then
transform</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687071621-22062008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=687071621-22062008>SELECT
ST_Length(St_MakeLine(ST_Transform(point,rightsridgoeshere))))/1000 as
distance<BR>
<DIV class="ArwC7c ckChnd" id=1fft>FROM (<BR> SELECT point
FROM points<BR> ORDER BY timestamp<BR>) as
p</DIV></SPAN></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=687071621-22062008></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>S<SPAN class=687071621-22062008>ome good places to
figure this out</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008>1) PostGIS Wiki</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008><A
href="http://postgis.refractions.net/support/wiki/index.php?plpgsqlfunctions">http://postgis.refractions.net/support/wiki/index.php?plpgsqlfunctions</A></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008>There is a function that given a point with a defined
SRID (not -1) will give you the SRID of the UTM zone for that
point</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008>2) <A
href="http://spatialreference.org/">http://spatialreference.org/</A></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008>Has a plethora of options and search to find the
spatial ref that works best for you.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008>Hope that helps,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008>Regina</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=687071621-22062008></SPAN></FONT></FONT></FONT> </DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>Joe
Roberts<BR><B>Sent:</B> Sunday, June 22, 2008 4:11 PM<BR><B>To:</B>
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] Newbie
- get total distance travelled from query ofpoints<BR></FONT><BR></DIV>
<DIV></DIV>Hi,<BR><BR>I am very new to PostGIS, and I'm stuck with what I hope
is an easy<BR>problem to solve.<BR><BR>I have a table which contains a list of
points, originating from a GPS<BR>device's lat/long output. I want to get the
distance travelled. I have<BR>the following query, but the result (distance)
looks far to low:<BR><BR>SELECT ST_Length(St_MakeLine(point))/1000 as
distance<BR>
<DIV class="ArwC7c ckChnd" id=1fft>FROM (<BR> SELECT point
FROM points<BR> ORDER BY timestamp<BR>) as p<BR><BR>I know
the route was over 5 miles (probably about about 8.4 km), but<BR>the query
returns 0.000106496.<BR><BR>Can anyone see what I am doing wrong? Is it my
query, or could it be<BR>my data?<BR><BR>Many
thanks<BR><BR>Joe</DIV></BODY></HTML>