[postgis-users] ERROR: GEOS difference() threw an error!

Obe, Regina robe.dnd at cityofboston.gov
Wed Oct 10 07:21:31 PDT 2007


Andreas,

I'm not sure what causes the below problem you described, but just to help zooming in further on the location of the problem, can you try the following statements separately and let us know if any return an error and how many records you get from each. 

SELECT ffh_id, st_geometrytype(ST_Union(the_geom)) As gtype
    FROM test_natura_full 
GROUP BY ffh_id
HAVING st_isvalid(ST_union(the_geom)) = false;

SELECT spa_id, st_geometrytype(ST_union(the_geom)) As 
 the_geom
    FROM test_natura_full 
GROUP BY spa_id
HAVING st_isvalid(ST_union(the_geom)) = false;

SELECT 
 ffh_singlerep.ffh_name,ffh_singlerep.ffh_land,ffh_singlerep.ffh,ffh_singlerep.ffh_id, 
    null as spa_name,null as spa_land,null as spa,null as spa_id,
    ST_Difference(ffh_singlerep.the_geom, test_natura_full.the_geom) As 
 the_geom
 FROM ffh_singlerep INNER JOIN (SELECT ffh_id, ST_union(the_geom) As 
 the_geom    
FROM test_natura_full GROUP BY ffh_id) As test_natura_full ON 
 ffh_singlerep.ffh_id = test_natura_full.ffh_id
    AND ST_Intersects(ffh_singlerep.the_geom, test_natura_full.the_geom)
 WHERE ST_IsEmpty(ST_Difference(ffh_singlerep.the_geom, 
 test_natura_full.the_geom)) = false;


 SELECT null as ffh_name,null as ffh_land,null as ffh,null as ffh_id,    
 spa_singlerep.spa_name,spa_singlerep.spa_land,spa_singlerep.spa,spa_singlerep.spa_id, 

    ST_Difference(spa_singlerep.the_geom, test_natura_full.the_geom) As 
 the_geom
 FROM spa_singlerep INNER JOIN  (SELECT spa_id, ST_union(the_geom) As 
 the_geom
    FROM test_natura_full GROUP BY spa_id) As test_natura_full ON 
 spa_singlerep.spa_id = test_natura_full.spa_id
    AND ST_Intersects(spa_singlerep.the_geom,test_natura_full.the_geom)
 WHERE ST_IsEmpty(ST_Difference(spa_singlerep.the_geom, 
 test_natura_full.the_geom)) = false;


Hope this helps,
Regina
 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Andreas Laggner
Sent: Tuesday, October 09, 2007 9:20 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ERROR: GEOS difference() threw an error!

Andreas Laggner schrieb:
> can someone tell me what causes this Error?
>
> ERROR: GEOS difference() threw an error!
> SQL Status:XX000
More Informations from the postgresql Logfile:
NOTICE:  TopologyException: found non-noded intersection between 
3.81546e+06 5.4495e+06, 3.81559e+06 5.44944e+06 and 3.81546e+06 
5.4495e+06, 3.81551e+06 5.44948e+06 3.81551e+06 5.44948e+06
ERROR:  GEOS difference() threw an error!

>
> the query:
> INSERT INTO test_natura_full
> SELECT 
> ffh_singlerep.ffh_name,ffh_singlerep.ffh_land,ffh_singlerep.ffh,ffh_singlerep.ffh_id, 
>
>    null as spa_name,null as spa_land,null as spa,null as spa_id,
>    ST_Difference(ffh_singlerep.the_geom, test_natura_full.the_geom) As 
> the_geom
> FROM ffh_singlerep INNER JOIN (SELECT ffh_id, ST_union(the_geom) As 
> the_geom
>    FROM test_natura_full GROUP BY ffh_id) As test_natura_full ON 
> ffh_singlerep.ffh_id = test_natura_full.ffh_id
>    AND ST_Intersects(ffh_singlerep.the_geom, test_natura_full.the_geom)
> WHERE ST_IsEmpty(ST_Difference(ffh_singlerep.the_geom, 
> test_natura_full.the_geom)) = false
> UNION
> SELECT null as ffh_name,null as ffh_land,null as ffh,null as ffh_id,
>    
> spa_singlerep.spa_name,spa_singlerep.spa_land,spa_singlerep.spa,spa_singlerep.spa_id, 
>
>    ST_Difference(spa_singlerep.the_geom, test_natura_full.the_geom) As 
> the_geom
> FROM spa_singlerep INNER JOIN  (SELECT spa_id, ST_union(the_geom) As 
> the_geom
>    FROM test_natura_full GROUP BY spa_id) As test_natura_full ON 
> spa_singlerep.spa_id = test_natura_full.spa_id
>    AND ST_Intersects(spa_singlerep.the_geom,test_natura_full.the_geom)
> WHERE ST_IsEmpty(ST_Difference(spa_singlerep.the_geom, 
> test_natura_full.the_geom)) = false;
>
>
> I had no problems with a small dataset (15 and 4 polygons), here i 
> have 28000 and 1500 rows. All geometries are valid and singlepart 
> Polygons.
>
> Cheers      Andreas
>
>


-- 
Dipl. Geoökologe Andreas Laggner
Institut für Ländliche Räume (LR)
Bundesforschungsanstalt für Landwirtschaft (FAL)

Institute of Rural Studies
Federal Agricultural Research Centre (FAL)

Bundesallee 50
D-38116 Braunschweig

Tel.: (+49) (0)531 596 5515
Fax: (+49) (0)531 596 5599
E-mail: andreas.laggner at fal.de
Homepage: http://www.lr.fal.de/ 

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

-----------------------------------------
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.




More information about the postgis-users mailing list