<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 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
@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:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Verdana","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;}
pre
        {mso-style-priority:99;
        mso-style-link:"Preformattato HTML Carattere";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:Courier;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-compose;
        font-family:"Verdana","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.PreformattatoHTMLCarattere
        {mso-style-name:"Preformattato HTML Carattere";
        mso-style-priority:99;
        mso-style-link:"Preformattato HTML";
        font-family:Courier;}
MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
        {page:Section1;}
-->
</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=IT link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US>Hi <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I’m a newbie to PostGIS and I have
same problem with function distance(geometry, geometry). I need to know the
distance between two points IN METERS but distance return a number that represent
the distance into carthesian system but I don’t know how convert this
number in meters… Or there is another war to do this!?!<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>PS.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I use geoserver to show maps and works very
well…<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>This is a my example query:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>select <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>distance(<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>          geomfromtext('POINT(14.7926950454712
41.1229515075684)', 4236), <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>          geomfromtext('POINT(14.7931413650513
41.1228904724121)', 4236) <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>    );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Return 0,000450473592882729 !?!!?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Since SRID 4236 has UNIT["degree",…]
I tried to use the “transform” function in this way:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>select  distance(<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>          transform(PointFromText('POINT(14.7926950454712
41.1229515075684)', 4236), 26986),<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>         
transform(PointFromText('POINT(14.7931413650513 41.1228904724121)', 4236),
26986)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>         
);<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Because SRID 26986 has UNIT["metre"…]<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>But I didn’t solve the problem.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Thanks Fabio<o:p></o:p></span></p>

</div>

</body>

</html>