<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Paul,<br>
<br>
AFAICT you are using ST_Cointains correctly, and MultiPolygons
shouldn't be an issue. I assume that your geometries have the same
SRID, otherwise PostGIS would complain.<br>
<br>
Can you post a full example (including the WKT of both geometries)
where you get false but expect true for ST_Contains(geomA, geomB)?<br>
<br>
Something like:<br>
<br>
SELECT ST_Contains('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))',
'POINT(5 5)') or<br>
SELECT ST_Contains('MULTIPOLYGON(((0 0, 0 10, 10 10, 10 0, 0 0)))',
'POINT(5 5)')<br>
<br>
so everyone can easily test this.<br>
<br>
Both yield true for my -- ancient ;-) -- POSTGIS="1.3.5"
GEOS="3.0.3-CAPI-1.4.2" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS<br>
<br>
Regards,<br>
Marc<br>
<br>
<br>
<br>
<br>
Am 22.10.2010 08:37, schrieb Marcos Paul:
<blockquote
cite="mid:AANLkTinYW=AYozz5=9fdh0hB3G=e6fm0=AtDARvri60c@mail.gmail.com"
type="cite">Hi Folks, <br>
<br>
I am trying to solve a simple problem: the point in polygon. First
of all, I have a CSV file with the polygons in list similar to the
WKT Format, that is something like: <br>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="256">
<col style="width: 48pt;" span="4" width="64"> <tbody>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt; width: 48pt;" height="20"
width="64">BUILT_UP_AREA_ID</td>
<td style="width: 48pt;" width="64">VERTEX_SEQ</td>
<td style="width: 48pt;" width="64">LATITUDE</td>
<td style="width: 48pt;" width="64">LONGITUDE</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">0</td>
<td align="right">152.6657</td>
<td align="right">-25.5206</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">1</td>
<td align="right">152.6662</td>
<td align="right">-25.5211</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">2</td>
<td align="right">152.6666</td>
<td align="right">-25.5216</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">3</td>
<td align="right">152.6673</td>
<td align="right">-25.5224</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">4</td>
<td align="right">152.668</td>
<td align="right">-25.523</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">5</td>
<td align="right">152.6694</td>
<td align="right">-25.5247</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">6</td>
<td align="right">152.67</td>
<td align="right">-25.5255</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">7</td>
<td align="right">152.6707</td>
<td align="right">-25.5263</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">8</td>
<td align="right">152.6734</td>
<td align="right">-25.5291</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">9</td>
<td align="right">152.6741</td>
<td align="right">-25.5295</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">10</td>
<td align="right">152.6745</td>
<td align="right">-25.5299</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">11</td>
<td align="right">152.675</td>
<td align="right">-25.5301</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">12</td>
<td align="right">152.676</td>
<td align="right">-25.5313</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">13</td>
<td align="right">152.6762</td>
<td align="right">-25.5317</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">14</td>
<td align="right">152.6764</td>
<td align="right">-25.5321</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">15</td>
<td align="right">152.6764</td>
<td align="right">-25.5333</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">16</td>
<td align="right">152.6766</td>
<td align="right">-25.534</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">17</td>
<td align="right">152.6766</td>
<td align="right">-25.5341</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">18</td>
<td align="right">152.6771</td>
<td align="right">-25.5341</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">19</td>
<td align="right">152.6774</td>
<td align="right">-25.534</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">20</td>
<td align="right">152.6788</td>
<td align="right">-25.5354</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">21</td>
<td align="right">152.6797</td>
<td align="right">-25.5361</td>
</tr>
<tr style="height: 15pt;" height="20">
<td style="height: 15pt;" align="right" height="20">1081</td>
<td align="right">22</td>
<td align="right">152.6788</td>
<td align="right">-25.5368<br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
From there I want to export that to my postgis data base, I solved
that converting the CSV to a Shape file and then applying the
shp2psql gui. <br>
<br>
When I am trying to check if a particular point is inside my table
I am just applying the following command: <br>
<br>
select ST_ASTEXT(the_geom) as multipolygons FROM Table_Polygons
WHERE ST_Contains(Table_Polygons.the_geom,
ST_GeometryFromText('POINT(X,Y)')); <br>
<br>
So after that, I am getting that the point X,Y is not inside one
of the polygons of my file, when I am completely sure that this
point is actually inside a polygon. <br>
<br>
What I am doing wrong? Does the fact that I am using
Multipolygons affect at all? <br>
<br>
Thank you for your help, <br>
<br>
Paul<br>
<br>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
<br>
</body>
</html>