<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>RE: [postgis-users] about st_distance</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>thanks , Regina</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=robe.dnd@cityofboston.gov
href="mailto:robe.dnd@cityofboston.gov">Obe, Regina</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=postgis-users@postgis.refractions.net
href="mailto:postgis-users@postgis.refractions.net">PostGIS Users
Discussion</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, October 03, 2008 7:49
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [postgis-users] about
st_distance</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV><!-- Converted from text/plain format -->
<P><FONT size=2>Francisco,<BR><BR>ST_Distance (you can think of as min
distance) returns the shortest distance between 2 geometries. So between
a point<BR>and a poly, if the point is in the poly the distance will be 0, it
its outside it would be the distance between the closest point on the surface
of the poly and the point. (there is actually another distance which no one
asks about ST_MaxDistance - which is between the most distant point of a poly
to a point - anyway I just mention it, but you wouldn't want to use it
here).<BR><BR>Your below query won't use indexes since ST_Distance doesn't use
an index. Use ST_Dwithin instead<BR><BR><BR>SELECT p.gid as
id_parcela,tipo as tipo_Pozo<BR>FROM selepozo(1,1) po,parcelas p<BR>WHERE
ST_DWithin(p.the_geom, po.the_geom, 1)<BR><BR><A
href="http://postgis.refractions.net/documentation/manual-svn/ST_DWithin.html">http://postgis.refractions.net/documentation/manual-svn/ST_DWithin.html</A><BR><BR>Hope
that helps,<BR>Regina<BR>-----Original Message-----<BR>From:
postgis-users-bounces@postgis.refractions.net on behalf of fsalas<BR>Sent: Fri
10/3/2008 7:01 AM<BR>To: postgis-users@postgis.refractions.net<BR>Subject:
[postgis-users] about st_distance<BR><BR>Hi,<BR><BR>I need to know about
obtain distance between polygon( parcels) and point<BR><BR>I Use the next
sentences<BR><BR>SELECT p.gid as id_parcela,tipo as tipo_Pozo FROM
selepozo(1,1) po,parcelas p WHERE ST_distance(p.the_geom, po.the_geom) <
1<BR><BR>I have some questions<BR><BR>This distance is between centroide of
parcels to point or between border of parcels to point ?<BR><BR><BR><BR>Best
Regards,<BR><BR>Francisco
Salas<BR><BR><BR>___________________________________<BR>Dpto de Sistemas
Informáticos<BR>Oficina Central Grupo Empresarial GEOCUBA<BR>Este mensaje esta
libre de virus.<BR>Revisado por Kaspersky
Antivirus<BR>----------------------------------------------------------------------<BR>Engine
version: 4.0.1.14<BR>Engine date: 2002/06/25<BR>Definition
count: 1148493<BR>Definition date: 2008/10/03<BR>MDAV version:
2.2.8<BR><BR><BR><BR><BR></FONT></P>
<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>
<P>
<HR>
<P></P>_______________________________________________<BR>postgis-users
mailing
list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE><br>___________________________________<br>
Dpto de Sistemas Informáticos<br>
Oficina Central Grupo Empresarial GEOCUBA<br>
Este mensaje esta libre de virus. <br>
Revisado por Kaspersky Antivirus<br>
----------------------------------------------------------------------<br>
Engine version: 4.0.1.14
Engine date: 2002/06/25
Definition count: 1156750
Definition date: 2008/10/06
MDAV version: 2.2.8
<br>
</body></HTML>