Hi all,<br><br>I stored all my geometry in SRID 4326. I would like to calculate the distance between 2 points in metter. <br><br>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
I see an example about ST_Distance_Sphere here: <a href="http://postgis.refractions.net/docs/ST_Distance_Sphere.html">http://postgis.refractions.net/docs/ST_Distance_Sphere.html</a><br><br><pre class="programlisting">SELECT round(CAST(ST_Distance_Sphere(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)',4326)) As numeric),2) As dist_meters,<br>
round(CAST(ST_Distance(ST_Transform(ST_Centroid(the_geom),32611),<br>             ST_Transform(ST_GeomFromText('POINT(-118 38)', 4326),32611)) As numeric),2) As dist_utm11_meters,<br>round(CAST(ST_Distance(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)', 4326)) As numeric),5) As dist_degrees,<br>
round(CAST(ST_Distance(ST_Transform(the_geom,32611),<br>          ST_Transform(ST_GeomFromText('POINT(-118 38)', 4326),32611)) As numeric),2) As min_dist_line_point_meters<br>FROM<br>       (SELECT ST_GeomFromText('LINESTRING(-118.584 38.374,-118.583 38.5)', 4326) As the_geom) as foo;<br>
         dist_meters | dist_utm11_meters | dist_degrees | min_dist_line_point_meters<br>  -------------+-------------------+--------------+----------------------------<br>         70424.47 |         <b style="color: rgb(0, 102, 0);"><font size="4">70438.00</font></b> |      0.72900 |                   65871.18<br>
</pre><br><span style="color: rgb(0, 153, 0);">SRID 32611: the distance is </span><b style="color: rgb(0, 153, 0);"><font><b><font size="4">70438.00</font></b></font></b><span style="color: rgb(0, 153, 0);"> metters.</span><br>
<br>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>If i changed SRID from 32611 to 900913<br>
<br><pre class="programlisting"> dist_meters | dist_utm11_meters | dist_degrees | min_dist_line_point_meters<br>    -------------+-------------------+--------------+----------------------------<br>         70424.47 |         <font style="color: rgb(0, 102, 0);" size="4"><b>89738.89</b></font> |      0.72900 |                   83857.70</pre>
<br><span style="color: rgb(0, 102, 0);">SRID 32611: the distance is </span><font style="color: rgb(0, 102, 0);" size="4"><b>89738.89</b></font><span style="color: rgb(0, 102, 0);"> metters</span><br>
<pre class="programlisting"><br></pre>I don't know what is the different between SRID 32611 and SRID 900913 ?<br>I should use 32611 or 900913 to calculate the distance in metter ?<br>Could i calculate distance by ST_Distance_Sphere for geometry with SRID 4326 ?<br>
Whats the different between ST_Distance_Sphere(SRID 4326), ST_Distance(SRID 32611), ST_Distance (SRID 900913) ?<br><br>Cheers.<br clear="all"><br>-- <br><div>
<div style="margin: 0in 0in 0pt;"><b><span style="color: rgb(31, 73, 125); font-size: 8pt;"><font face="Calibri">Liem Nguyen (DBA)<br><br>AXON ACTIVE 
VIETNAM</font></span></b></div>
<div style="margin: 0in 0in 0pt;"><b><span style="color: rgb(31, 73, 125); font-size: 8pt;" lang="DE-CH"><a href="http://www.axonactive.vn/" target="_blank"><span lang="EN-US"><font color="#0000ff" face="Calibri">www.axonactive.vn</font></span></a></span></b><b><span style="color: rgb(31, 73, 125); font-size: 8pt;"></span></b></div>

<div style="margin: 0in 0in 0pt;"><span style="color: rgb(31, 73, 125); font-size: 8pt;"><font face="Calibri"> </font></span></div>
<div style="margin: 0in 0in 0pt;"><span style="color: rgb(31, 73, 125); font-size: 8pt;"><font face="Calibri">10th Floor, Hai Au 
Building, 39B Truong Son, Ward 4, Tan Binh District, Ho Chi Minh City, 
Vietnam</font></span></div>
<div style="margin: 0in 0in 0pt;"><span style="color: rgb(31, 73, 125); font-size: 8pt;"><font face="Calibri">T +84 8 629 738 59, F 
+84 8 381 134 89, M +84 168 994 8897</font></span></div>
<div style="margin: 0in 0in 0pt;"><span style="font-size: 8pt;"><font size="1"><u>8897 +10° 48' 32.72", +106° 39' 
51.58"</u></font></span></div><pre><br></pre></div><br>