<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 10.00.9200.16798"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr align=left><SPAN class=816351722-21022014><FONT color=#0000ff 
size=2 face=Arial>Mike,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=816351722-21022014><FONT color=#0000ff 
size=2 face=Arial>You have your coordinates backwards.  It's 
longitude,latitude not latitude, longitude</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=816351722-21022014><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=816351722-21022014><FONT color=#0000ff 
size=2 face=Arial>select st_distance_sphere(<BR>    
st_setsrid(st_makepoint(-82.60, 33.44), 4326),  -- location near Warrenton, 
GA<BR>    st_setsrid(st_makepoint(-82.517, 33.533 ), 4326) -- 
locaton near Thomson, GA<BR>);<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=816351722-21022014><FONT color=#0000ff 
size=2 face=Arial>12891.373014397  meters</FONT></SPAN></DIV>
<DIV><SPAN class=816351722-21022014><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=816351722-21022014><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>select 
st_distance_sphere(<BR>    st_setsrid(st_makepoint(-82.60, 
33.44), 4326),  -- location near Warrenton, GA<BR>    
st_setsrid(st_makepoint(-97.361, 32.819), 4326) -- location near Forth Worth, 
TX<BR>)</FONT><BR></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014><FONT color=#0000ff size=2 
face=Arial> </FONT></SPAN></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014></SPAN> </DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014><FONT color=#0000ff size=2 
face=Arial>1,375,107.45231354 meters</FONT> </SPAN></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014><FONT color=#0000ff size=2 face=Arial>Hope that 
helps,</FONT></SPAN></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014><FONT color=#0000ff size=2 
face=Arial>Regina</FONT></SPAN></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014><FONT color=#0000ff size=2 face=Arial><A 
href="http://www.postgis.us">http://www.postgis.us</A></FONT></SPAN></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><SPAN 
class=816351722-21022014><FONT color=#0000ff size=2 face=Arial><A 
href="http://postgis.net">http://postgis.net</A></FONT></SPAN></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left><FONT size=2 
face=Tahoma><B>From:</B> postgis-users-bounces@lists.osgeo.org 
[mailto:postgis-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Michael 
shutt<BR><B>Sent:</B> Friday, February 21, 2014 5:05 PM<BR><B>To:</B> 
postgis-users@lists.osgeo.org<BR><B>Subject:</B> [postgis-users] 
st_distance_sphere usage<BR></FONT><BR></DIV>
<DIV></DIV>I am working with PostgreSQL v9.1.11 and PostGIS 2.1.0.  I am 
trying to use st_distance_sphere to calculate the distance between various 
points and am getting results that don't make sense.  According to the 
documentation, that function should return the distance in meters between the 2 
points supplied.  Here are two examples that demonstrate the issue I am 
having:<BR><BR><FONT face="Courier New, Courier, monospace">select 
st_distance_sphere(<BR>    st_setsrid(st_makepoint(33.44, 
-82.60), 4326),  -- location near Warrenton, GA<BR>   
 st_setsrid(st_makepoint(33.533, -82.517), 4326) -- locaton near Thomson, 
GA<BR>)<BR></FONT><BR>returns 9325.862 meters, or 5.8 miles, which seems 
correct<BR><BR><FONT face="Courier New, Courier, monospace">select 
st_distance_sphere(<BR>    st_setsrid(st_makepoint(33.44, 
-82.60), 4326),  -- location near Warrenton, GA<BR>   
 st_setsrid(st_makepoint(32.819, -97.361), 4326) -- location near Forth 
Worth, TX<BR>)<BR></FONT><BR>returns 9873.560 meters, or 6.1 miles, which ain't 
even close.<BR><BR>I have read and re-read the PostGIS docs and can't find 
anything I am doing wrong.  Is that function misbehaving or am I using it 
incorrectly?<BR><BR>Thanks in advance<BR><BR>Mike<BR></BODY></HTML>