<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 14 (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:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I am calculating distance from my current location with all available regions(polygons) in my table.<o:p></o:p></p><p class=MsoNormal>I am using ST_Distance method for this.<o:p></o:p></p><p class=MsoNormal>My regions are stored with SRID = 900913.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Distance for point in Europe from USA region is coming as 122.78.<o:p></o:p></p><p class=MsoNormal>How come this possible. These regions are so far.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is my query. Can you please suggest me how can I get actual distance in meters here.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>SELECT ST_distance<o:p></o:p></p><p class=MsoNormal>(st_geomfromtext('point(-123.574219125 47.8131546948944 0)', 900913),<o:p></o:p></p><p class=MsoNormal>st_geomfromtext('LINESTRING(-0.791015625 48.4874864798841,9.4921875 54.5975278521139,27.59765625 55.3541353102106,36.38671875 48.3124279040718,22.32421875 40.3465441211801,5.888671875 43.8662180065564,-0.791015625 48.4874864798841)', 900913)<o:p></o:p></p><p class=MsoNormal>)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Query returns 122.785055218779<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>SELECT ST_Distance_Sphere<o:p></o:p></p><p class=MsoNormal>(st_geomfromtext('point(-123.574219125 47.8131546948944 0)', 900913),<o:p></o:p></p><p class=MsoNormal>st_geomfromtext('LINESTRING(-0.791015625 48.4874864798841,9.4921875 54.5975278521139,27.59765625 55.3541353102106,36.38671875 48.3124279040718,22.32421875 40.3465441211801,5.888671875 43.8662180065564,-0.791015625 48.4874864798841)', 900913)<o:p></o:p></p><p class=MsoNormal>)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Query returns 7808837.70565995<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>But still its less only as this in in meters. Is it bcs I m calculating distance between point and polygon.<o:p></o:p></p><p class=MsoNormal>ST_Distance_Sphere works great for point to point distance.<o:p></o:p></p><p class=MsoNormal>What is significance of SRID here. Am I missing something?<o:p></o:p></p><p class=MsoNormal>Which SRID should we use for general purpose.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>Thanks,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>Archana Ghag<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>---------------------------------------------------- <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:"Verdana","sans-serif"'>Technology Architect<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:"Verdana","sans-serif"'>Microsoft Technology Center<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:"Verdana","sans-serif"'>Infosys Technologies Limited<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:"Verdana","sans-serif"'>B1, IT Park 1, Hinjawadi, Pune - 411057<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:"Verdana","sans-serif"'>Tel:  2022978913(VOIP) : +91-9850872739 (Mobile)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:"Verdana","sans-serif"'>email: <a href="mailto:archana_ghag@infosys.com"><span style='color:blue'>archana_ghag@infosys.com</span></a><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>
<table><tr><td bgcolor=#ffffff><font color=#000000><pre>**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***</pre></font></td></tr></table>