[postgis-devel] [PostGIS] #1045: TopologyException if I don't use ST_Dump to resolve single geometries before I do ST_Intersection

PostGIS trac at osgeo.org
Tue Jun 21 01:27:12 PDT 2011


#1045: TopologyException if I don't use  ST_Dump to resolve single geometries
before I do ST_Intersection
-------------------------------------------------------+--------------------
 Reporter:  laopsahl                                   |       Owner:  pramsey      
     Type:  defect                                     |      Status:  new          
 Priority:  medium                                     |   Milestone:  PostGIS 1.5.4
Component:  postgis                                    |     Version:  1.5.X        
 Keywords:  TopologyException ST_intersection ST_Dump  |  
-------------------------------------------------------+--------------------
 I have a set of polygon's in table “tmp_test2.union_bestand_flate_covered”
 that that I use to find the difference from table
 “tmp_test2.dekning_omr_flate”. The result of this difference I use to do a
 intersection against tmp_test2.satskog_landsdekkende_flate.

 The SQL below fails


 {{{
 SELECT
 ST_Intersection(db2.non_covered,s.geo) dekn_sats
 FROM (
 SELECT
 ST_Difference(d2.geo,db1.bestand_flate_covered) non_covered
 FROM tmp_test2.union_bestand_flate_covered db1,
 tmp_test2.dekning_omr_flate d2
 ) as db2, tmp_test2.satskog_landsdekkende_flate s
 where ST_Intersects(db2.non_covered,s.geo)
 }}}

 with the error

 NOTICE: TopologyException: found non-noded intersection between LINESTRING
 (11.8148 64.517, 11.8056 64.5117) and LINESTRING (11.8076 64.5129, 11.809
 64.51 3
 ERROR: GEOS Intersection() threw an error!

 Here is a SQL that works ok

 {{{
 SELECT
 ST_Intersection(db2.non_covered,s.geo) dekn_sats
 FROM (
 SELECT
 (ST_Dump(ST_Difference(d2.geo, db1.bestand_flate_covered))).geom as
 non_covered
 FROM tmp_test2.union_bestand_flate_covered db1,
 tmp_test2.dekning_omr_flate d2
 ) as db2, tmp_test2.satskog_landsdekkende_flate s
 where ST_Intersects(db2.non_covered,s.geo)
 }}}


 and I get the result below.
 0103000020A21000000100000005000000AB505691D08627400E85D5077C205040B068C5E193862740B7954B9A7C205040ACCA75DE8E8627401DF1C3F87C205040E13EFD33D18627400749EDD0
 27400E85D5077C205040
 (1 row)


 The function ST_Valid returns true for all involved polygons in all
 tables. The object tmp_test2.satskog_landsdekkende_flate is also valid,
 but the boundary of the polygon to intersect with itself. (From OpenGIS®
 Simple Features Specification, 3.3.2.9 Polygons (The Linear Rings in the
 boundary of a polygon may intersect at most at a single point but only as
 a tangent. ))

 I run on the following versions of postgreSQL and postgis.

 PostgreSQL 8.4.4 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC)
 4.1.2 20080704 (Red Hat 4.1.2-48), 64-bit

 POSTGIS="1.5.1" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September
 2009" LIBXML="2.6.26" USE_STATS

 In the file /tmp/tmp_test2.dump I have added all the tables that I use.

 Lars

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1045>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list