<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2>Forgot to mention 2163 - my mention of pretty good may
not be as good as your idea and my "pretty good" definition actually varies
depending on what function I am trying to do. I guess I should have said
"May be good enough" rather than pretty good.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2>2163 will give you a ball park figure (say within a couple
meters of accuracy) and the further the geometries are away from each other
I think the worse that ballpark figure gets.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2>If you are doing surveying work or launching missiles -
2163 is horrible and you'll want something like UTM or stateplane
(basically a conformal projection that covers smaller area). It is
all a matter of trade-offs.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2>Regina</FONT> </SPAN><SPAN
class=317143811-19032008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=317143811-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>Obe,
Regina<BR><B>Sent:</B> Wednesday, March 19, 2008 6:56 AM<BR><B>To:</B> PostGIS
Users Discussion<BR><B>Subject:</B> RE: [postgis-users] How to get the distance
between geometry inmeters?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>You'll need to transform to a meter based projection to do
that. If for example you are in the U.S, SRID 2163 US National Atlas Equal
Area works pretty good for measurement. It is not as accurate as UTM
or State Plane, but its pretty good and covers all of US I believe and probably
works for some of Canada as well (not sure about non-continental e.g.
Hawaii, Alaska). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>e.g.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>SELECT road.rd_name, ht.ht_name,
ST_Distance(ST_Transform(roads.the_geom,2163) ,
ST_Transform(hotel.the_geom,2163)) as dist_meters</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>FROM road, hotel</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>WHERE <some criteria
here></FONT></SPAN></DIV></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>If you are somewhere else and your locations are within
that projection, you can use that. Look at the utmzone function in
the wiki that will help you determing the right UTM zone SRID for your
data</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2><A
href="http://postgis.refractions.net/support/wiki/index.php?plpgsqlfunctions">http://postgis.refractions.net/support/wiki/index.php?plpgsqlfunctions</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>So you would use something liek</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>SELECT utmzone(ST_Centroid(the_geom)) as
srid</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>to get the right UTM zone SRID</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=102324810-19032008><FONT face=Arial
color=#0000ff size=2>Regina</FONT></SPAN></DIV>
<DIV><SPAN class=102324810-19032008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=102324810-19032008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of
</B>Sinboy Chang<BR><B>Sent:</B> Wednesday, March 19, 2008 3:09 AM<BR><B>To:</B>
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] How to
get the distance between geometry in meters?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>i want to get the distance between geometry,just like road or
hotel poi,but ST_Distance() return the result in <EM>cartesian
dintance.</EM></DIV>
<DIV>So how can get the distance() by meters?</DIV>
<P>
<HR SIZE=1>
<P></P>
<P><STRONG>The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure pursuant to
Massachusetts law. It is intended solely for the addressee. If you received this
in error, please contact the sender and delete the material from any computer.
</STRONG></P>
<P>
<HR SIZE=1>
<P></P>
<P><STRONG><FONT color=#339900 size=2>Help make the earth a greener place. If at
all possible resist printing this email and join us in saving paper. </P>
<P></FONT></STRONG></P></BODY></HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>
<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>