Hi Mike <br><br>Thanx for your reply ...but my geometry has 5 points .. <br>please see the attached file .. <br>I get all the polygons for isvalid() and also for NOT isvalid() ... <br><br>Thanks<br>Sandeep<br><br><br><div>
<span class="gmail_quote">On 11/26/06, <b class="gmail_sendername">Michael Fuhr</b> <<a href="mailto:mike@fuhr.org">mike@fuhr.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sun, Nov 26, 2006 at 06:52:13PM +0530, Sandeep Kumar Jakkaraju wrote:<br>> when i am runnig this query<br>><br>> select name from tiles where contains(tilebounds,GEOMFROMTEXT('POINT(0<br>> 0)'));<br>><br>
> I get this error :<br>><br>> NOTICE:  IllegalArgumentException: point array must contain 0 or >1 elements<br>> ERROR:  POSTGIS2GEOS conversion failed<br><br>I'd guess that you have at least one bad geometry, 
e.g., a POLYGON<br>with a ring that has exactly one point.  The following example<br>replicates the above error:<br><br>CREATE TABLE tiles (name text);<br>SELECT AddGeometryColumn('tiles', 'tilebounds', -1, 'GEOMETRY', 2);
<br>INSERT INTO tiles (name, tilebounds) VALUES ('test', '0103000000010000000100000000000000000000000000000000000000');<br><br>SELECT name, AsText(tilebounds) FROM tiles;<br> name |     astext<br>------+----------------<br>
 test | POLYGON((0 0))<br>(1 row)<br><br>SELECT name FROM tiles WHERE Contains(tilebounds, GeomFromText('POINT(0 0)'));<br>NOTICE:  IllegalArgumentException: point array must contain 0 or >1 elements<br><br>ERROR:  POSTGIS2GEOS conversion failed
<br><br>You might be able to find the bad geometry with isvalid() or<br>npoints():<br><br>SELECT name, AsText(tilebounds) FROM tiles WHERE NOT isvalid(tilebounds);<br>SELECT name, AsText(tilebounds) FROM tiles WHERE npoints(tilebounds) = 1;
<br><br>--<br>Michael Fuhr<br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Sandeep Kumar Jakkaraju <br>WeBlog:<br><a href="http://jakkarajus.blogspot.com">http://jakkarajus.blogspot.com
</a>