Hi,<br>just a note:<br><br>inserting the same geometry :<br><br>INSERT INTO bug (gid, the_geom) VALUES (<br>1  , '0103000020BE6B0000010000000400000081F178483F4F2841D730212506D33C418045F71F474F2841D706623902D33C417E45F71F474F2841D806623902D33C4181F178483F4F2841D730212506D33C41'<br>
);<br><br>and <br><br>INSERT INTO bug (gid, the_geom) VALUES (2,st_geomfromtext('POLYGON((<br>796575.641547725 1889030.1450377,<br>796579.562433407 1889026.22415202,<br>796579.562433406 1889026.22415202,<br>796575.641547725 1889030.1450377))',-1))<br>
<br>then :<br>SELECT gid, st_area(the_geom), astext(centroid(the_geom)), isvalid(the_geom)<br>FROM bug<br><br>returns:<br><br>1; 0.0001220703125;"GEOMETRYCOLLECTION EMPTY";t<br>2; 0.0001220703125;"POINT(796578.255471513 1889027.53111391)";t<br>
<br>!!<br><br>Fred.<br><br><br><br><br><div class="gmail_quote">On Wed, Dec 10, 2008 at 9:06 AM, Ghislain Geniaux <span dir="ltr"><<a href="mailto:geniaux@avignon.inra.fr">geniaux@avignon.inra.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Exact,<br>
 that's the problem :<br>
<br>
scot3=# SELECT gid, the_geom<br>
scot3-# FROM bd_dispo_final<br>
scot3-# WHERE isempty(centroid(the_geom));<br>
  gid  |                                                                              the_geom<br>
-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
 16435 | 0103000020BE6B0000010000000400000081F178483F4F2841D730212506D33C418045F71F474F2841D706623902D33C417E45F71F474F2841D806623902D33C4181F178483F4F2841D730212506D33C41<br>
(1 row)<br>
<br>
<br>
Here, you will find  the ouput of  pg_dump to study this geometrry. Thanks again.<br>
<br>
<br>
<br>
--<br>
-- PostgreSQL database dump<br>
--<br>
<br>
SET client_encoding = 'SQL_ASCII';<br>
SET standard_conforming_strings = off;<br>
SET check_function_bodies = false;<br>
SET client_min_messages = warning;<br>
SET escape_string_warning = off;<br>
<br>
SET search_path = public, pg_catalog;<br>
<br>
SET default_tablespace = '';<br>
<br>
SET default_with_oids = false;<br>
<br>
--<br>
-- Name: bug; Type: TABLE; Schema: public; Owner: postgres; Tablespace:--<br>
<br>
CREATE TABLE bug (<br>
    gid integer,<br>
    the_geom geometry<br>
);<br>
<br>
<br>
ALTER TABLE public.bug OWNER TO postgres;<br>
<br>
--<br>
-- Data for Name: bug; Type: TABLE DATA; Schema: public; Owner: postgres<br>
--<br>
<br>
COPY bug (gid, the_geom) FROM stdin;<br>
16435   0103000020BE6B0000010000000400000081F178483F4F2841D730212506D33C418045F71F474F2841D706623902D33C417E45F71F474F2841D806623902D33C4181F178483F4F2841D730212506D33C41<br>
\.<br>
<br>
<br>
--<br>
-- PostgreSQL database dump complete<br><font color="#888888">
--<br>
<br>
<br>
Le 9 déc. 08 à 13:04, Obe, Regina a écrit :</font><div><div></div><div class="Wj3C7c"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Ghislain,<br>
<br>
The only time I have seen this kind of behavior is when centroid returns an empty geometry collection.  In those cases its because the geometry is invalid.<br>
<br>
Although none of your geometries are invalid, it could be a bug in either the centroid code or isvalid check that may or may not be fixed in 3.0.3+ of GEOS.<br>
<br>
<br>
Can you do the following<br>
<br>
SELECT gid, the_geom<br>
FROM ZS2C<br>
WHERE isempty(centroid(the_geom))<br>
<br>
<br>
and send us as an attatched file with one of those geometries.  We can cross check with GEOS 3.0.3 or 3.1 to see if the issue still remains.<br>
<br>
Thanks,<br>
Regina<br>
-----Original Message-----<br>
From: <a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a> [mailto:<a href="mailto:postgis-" target="_blank">postgis-</a><a href="mailto:users-bounces@postgis.refractions.net" target="_blank">users-bounces@postgis.refractions.net</a>] On Behalf Of Ghislain Geniaux<br>

Sent: Monday, December 08, 2008 1:29 PM<br>
To: PostGIS Users Discussion<br>
Subject: Re: [postgis-users] how to identify the_geom that cause:RelateOperation called withLWGEOMCOLLECTION type<br>
<br>
On Linux  :<br>
<br>
POSTGIS="1.3.1" GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.0, 21 Dec<br>
2007" USE_STATS<br>
(1 row)<br>
<br>
On Macos<br>
<br>
  POSTGIS="1.2.1" GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.0, 21 Dec<br>
2007" USE_STATS<br>
(1 row)<br>
<br>
same result with the two platform and postgis version.<br>
<br>
Thanks.<br>
<br>
Le 8 déc. 08 à 17:53, Paragon Corporation a écrit :<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What does<br>
<br>
SELECT postgis_full_version();<br>
<br>
Return<br>
<br>
Thanks,<br>
Regina<br>
-----Original Message-----<br>
From: <a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a><br>
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of<br>
Ghislain<br>
Geniaux<br>
Sent: Monday, December 08, 2008 11:03 AM<br>
To: PostGIS Users Discussion<br>
Subject: Re: [postgis-users] how to identify the_geom that cause<br>
:RelateOperation called withLWGEOMCOLLECTION type<br>
<br>
I've no collection. It's looks like a bug.<br>
<br>
Moreover my table is very large wiht more than 500 000 geometry and i<br>
found no solution to identy the wrong geom.<br>
<br>
Here you can see the query, with the same result on different<br>
plateform (LINUX DEBIAN, MACOS, with GEOS 3)<br>
<br>
otm=# select distinct geometrytype(the_geom) from ZS2c;<br>
  geometrytype<br>
--------------<br>
  MULTIPOLYGON<br>
(1 row)<br>
<br>
otm=# select distinct geometrytype(the_geom) from bd_dispo_finalc ;<br>
  geometrytype<br>
--------------<br>
  MULTIPOLYGON<br>
  POLYGON<br>
(2 rows)<br>
<br>
otm=# create table info_nonvoue1 as<br>
otm-# select b.id_parc, z.niv from bd_dispo_finalc as b, ZS2c as z<br>
otm-# where z.niv=1 and intersects(centroid(b.the_geom),z.the_geom)<br>
and b.the_geom && z.the_geom and isvalid(b.the_geom) and isvalid<br>
(z.the_geom);<br>
ERROR:  Relate Operation called with a LWGEOMCOLLECTION type.  This<br>
is unsupported<br>
otm=#<br>
<br>
<br>
<br>
Le 8 déc. 08 à 13:32, Obe, Regina a écrit :<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Many of the GEOS relation functions do not work with collections.<br>
<br>
You must have a geometry collection in there somewhere or its a bug.<br>
Also which relation function were you trying?<br>
<br>
To figure out the type of your geometries, run<br>
<br>
SELECT *<br>
FROM sometable<br>
WHERE GeometryType(the_geom) = 'GEOMETRYCOLLECTION'<br>
<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a><br>
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of<br>
Nicolas Ribot<br>
Sent: Monday, December 08, 2008 6:22 AM<br>
To: PostGIS Users Discussion<br>
Subject: Re: [postgis-users] how to identify the_geom that cause :<br>
RelateOperation called withLWGEOMCOLLECTION type<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have an error with some geometry that cause : "ERROR Relate<br>
</blockquote>
Operation<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
called withLWGEOMCOLLECTION type".<br>
All the geometries seem clean (valid, non empty, closed, only<br>
POLYGON,<br>
</blockquote>
..)<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
My question : how to get information of which geometry cause the<br>
</blockquote>
problem ?<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a way  to have information about the geometry during<br>
postgis<br>
</blockquote>
is<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
working on a  SQL query ?<br>
Thanks.<br>
<br>
</blockquote>
<br>
Hi Ghislain,<br>
<br>
What the query that failed looks like ?<br>
The message is telling that one geometry has an invalid type.<br>
In your query, you could try to ask for ST_GeometryType(geometry) and<br>
a geometry identifier to see which geometry has the wrong type.<br>
If you perform a spatial operation, it is possible that<br>
geometryCollection is produced.<br>
You could maybe split your query into smaller block to see where such<br>
collections are generated.<br>
<br>
Nicolas<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
-----------------------------------------<br>
The substance of this message, including any attachments, may be<br>
confidential, legally privileged and/or exempt from disclosure<br>
pursuant to Massachusetts law. It is intended<br>
solely for the addressee. If you received this in error, please<br>
contact the sender and delete the material from any computer.<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote>
<br>
<br>
<br>
------------------------------------------<br>
Geniaux Ghislain<br>
INRA SAD Ecodéveloppement<br>
Site Agroparc<br>
Domaine St Paul<br>
84914 Avignon Cedex 9<br>
<br>
Tél : 04 32 72 25 64<br>
Fax : 04 32 72 25 62<br>
<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br>
<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote>
<br>
<br>
<br>
------------------------------------------<br>
Geniaux Ghislain<br>
INRA SAD Ecodéveloppement<br>
Site Agroparc<br>
Domaine St Paul<br>
84914 Avignon Cedex 9<br>
<br>
Tél : 04 32 72 25 64<br>
Fax : 04 32 72 25 62<br>
<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
-----------------------------------------<br>
The substance of this message, including any attachments, may be<br>
confidential, legally privileged and/or exempt from disclosure<br>
pursuant to Massachusetts law. It is intended<br>
solely for the addressee. If you received this in error, please<br>
contact the sender and delete the material from any computer.<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote>
<br>
<br>
<br>
------------------------------------------<br>
Geniaux Ghislain<br>
INRA SAD Ecodéveloppement<br>
Site Agroparc<br>
Domaine St Paul<br>
84914 Avignon Cedex 9<br>
<br>
Tél : 04 32 72 25 64<br>
Fax : 04 32 72 25 62<br>
<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br>