[postgis-devel] [PostGIS] #1733: ST_Difference fails with two valid geometries

PostGIS trac at osgeo.org
Wed Mar 28 14:26:32 PDT 2012


#1733: ST_Difference fails with two valid geometries
---------------------+------------------------------------------------------
 Reporter:  pracine  |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------
 {{{
 SELECT ST_Difference(ageom, bgeom),
        ST_IsValid(ageom) a_isvalid,
        ST_IsValid(bgeom) b_isvalid,
        ST_AsText(ageom) a_text,
        ST_AsText(bgeom) b_text,
        ST_GeometryType(ageom) a_type,
        ST_GeometryType(bgeom) b_type,
        ST_Summary(ageom) a_sum,
        ST_Summary(bgeom) b_sum,
        ageom::text a_ewkb,
        bgeom::text b_ewkb
 FROM
 (SELECT a.geom ageom,
         b.geom bgeom
 FROM
 (SELECT
 '010300002040A5000001000000050000001D020000F41831C1E399231EE6F729411C020000F41831C1B992E9C61EFB29411C020000F41831C156E1297A1CFB29411A493FC38F1831C1D8C6FEFCFEF929411D020000F41831C1E399231EE6F72941'::geometry
 geom
 ) a
 ,
 (SELECT
 '010300002040A5000001000000040000001D020000F41831C1056DF2EC6AFA29411C020000F41831C1D1D1C8A2C7FA2941D6FA5B26EC1831C1C8F5FEAEBBFA29411D020000F41831C1056DF2EC6AFA2941'::geometry
 geom
 ) b) foo
 }}}

 fails with this message:

 ERROR:  GEOSDifference: TopologyException: found non-noded intersection
 between LINESTRING (-1.1205e+06 851294, -1.1205e+06 851343) and LINESTRING
 (-1.1205e+06 851343, -1.1205e+06 851342) at -1120500.0000001257
 851343.3885007716

 geom a has 5 points and geom b has 4 points. Both are valid.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1733>
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