Hi, just an update on this, found the solution thanks to user: nhv on #postgis. I was setting the long & lat the wrong way round when creating my points and instead of doing all the transforming and stuff I've just used st_distance_sphere(). <br>
<br>Solution below:<br><br><span style="font-family: courier new,monospace;">SELECT ST_Distance_Sphere(</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    ST_SetSRID(ST_Point(-1.54911, 53.7996374 ), 4326),</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    ST_SetSRID(ST_Point(-1.0822855, 53.9577018), 4326)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  ) / 1000;</span><br style="font-family: courier new,monospace;">
<br>I know it can be more accurate using ST_Distance_Spheroid() but i need speed over precise accuracy in this case.<br><br>Thanks,<br>- Jimmy<br><br><br><div class="gmail_quote">On Sun, Jan 25, 2009 at 3:03 PM, Jimmy Forrester <span dir="ltr"><<a href="mailto:jimmy@sparkleinteractive.co.uk">jimmy@sparkleinteractive.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hey all, I'm new to postgis and implementing a few geographic features in to my site. I'm having a bit of difficulty getting my distance calculations working: <br>
<br><font size="1"><span style="font-family: courier new,monospace;">select ST_Distance(    ST_Transform(ST_SetSRID(ST_Point(53.7996374, -1.54911),     4326), 2163), </span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">            ST_Transform(ST_SetSRID(ST_Point(53.6451179, -1.784876),     4326), 2163)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        ) / 1000</span></font><br>

<br><br>In the query above I'm testing the distance between Leeds & Huddersfield. I'm trying to convert the 4326 srid  geom to  srid 2163 which is meters (i think!). For an unknown reason this is returning 64 km which i know is incorrect.<br>

<br>I've plotted the coords on google maps and they are definitely correct, google maps says the distance is about 24 km. see:<br><br><font size="1"><a href="http://www.google.com/maps?f=d&source=s_d&saddr=53.7996374,+-1.54911&daddr=53.6451179,+-1.784876&hl=en&geocode=FdXqNAMdylzo_w%3BFT6PMgMd1MPk_w&mra=ls&dirflg=w&doflg=ptk&sll=53.722107,-1.645889&sspn=0.161297,0.418854&ie=UTF8&ll=53.72231,-1.667175&spn=0.161296,0.418854&t=h&z=12" target="_blank">http://www.google.com/maps?f=d&source=s_d&saddr=53.7996374,+-1.54911&daddr=53.6451179,+-1.784876&hl=en&geocode=FdXqNAMdylzo_w%3BFT6PMgMd1MPk_w&mra=ls&dirflg=w&doflg=ptk&sll=53.722107,-1.645889&sspn=0.161297,0.418854&ie=UTF8&ll=53.72231,-1.667175&spn=0.161296,0.418854&t=h&z=12</a><br>

</font><br>Any help on this would be great,<br><br>Thanks,<br><font color="#888888">Jimmy<br>
</font></blockquote></div><br>