<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm trying to use the operator && to find
the polygon</FONT></DIV>
<DIV><FONT face=Arial size=2>that contains a point. (Are there other way to
do this in PostGIS?)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>So, I create the select below: </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">SELECT continent_name </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">FROM continent </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">WHERE the_geom &&
GeometryFromText('BOX3D(-45.69439 -23.5642, -45.69439 -23.5642)'::box3d,-1);
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office"
/><o:p></o:p></P></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>How the point doesn't have a box, I repeat the same
coordinates.</FONT></DIV>
<DIV><FONT face=Arial size=2>The continent is the world continent
table.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The result was: South America,
Oceania.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I became surprise by Oceania and I saw that Oceania
is a multpolygon geometry.</FONT></DIV>
<DIV><FONT face=Arial size=2>When the PostGIS generate the box of Oceania
polygons, the result are the box resultant</FONT></DIV>
<DIV><FONT face=Arial size=2>of all box isolated polygons. By this, my point is
in Oceania too.</FONT></DIV>
<DIV><FONT face=Arial size=2>See the select bellow:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>gisdb=# select continent, box3D(the_geom) from
continent where continent='Oceania';<BR> continent
|
box3d<BR>---------------+--------------------------------------------------------<BR> Oceania
| BOX3D(-180 -52.5780563354492 0,180 28.2215194702148 0)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In another case, but in this case I
didn't understand why, the result get 2 polygons having the</FONT></DIV>
<DIV><FONT face=Arial size=2>same point, but this point ins't in the border of
two polygons (I visually have shure!). </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>gisdb=# SELECT nomemunicp, uf FROM brmuni WHERE
the_geom && GeometryFromText<BR>('BOX3D(-45.69439 -23.5642, -45.69439
-23.5642)'::box3d,-1);<BR> nomemunicp |
uf<BR>-----------------------+----<BR> PARAIBUNA |
SP<BR> CARAGUATATUBA | SP</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2>Rosāngela</FONT></DIV></BODY></HTML>