[postgis-devel] [PostGIS] #1654: Lines added to topology with a tolerance don't get properly snapped

PostGIS trac at osgeo.org
Tue Mar 6 07:51:04 PST 2012


#1654: Lines added to topology with a tolerance don't get properly snapped
----------------------+-----------------------------------------------------
 Reporter:  strk      |       Owner:  strk         
     Type:  defect    |      Status:  new          
 Priority:  medium    |   Milestone:  PostGIS 2.0.0
Component:  topology  |     Version:  2.0.x        
 Keywords:            |  
----------------------+-----------------------------------------------------
 See this session:

 {{{
 SELECT CreateTopology('tt');
 SELECT ST_AddIsoNode('tt', 0, 'POINT(0 0)');
 SELECT TopoGeo_addLineString('tt', 'LINESTRING(-10 1, 10 1)', 2);
 SELECT TopologySummary('tt');
 }}}

 The linestring is at distance=1 from the point, should be snapped to it
 since we request tolerance=2.

 Debugging:

 {{{
 strk=# SELECT TopoGeo_addLineString('tt', 'LINESTRING(-10 1, 10 1)', 2);
 DEBUG:  Self-noded: LINESTRING(-10 1,10 1)
 DEBUG:  WITH nearby AS ( SELECT e.geom FROM tt.edge e WHERE
 ST_DWithin(e.geom,
 '01020000000200000000000000000024C0000000000000F03F0000000000002440000000000000F03F'::geometry,
 2) ) SELECT st_collect(geom) FROM nearby;
 DEBUG:  WITH nearby AS ( SELECT n.geom FROM tt.node n WHERE
 ST_DWithin(n.geom,
 '01020000000200000000000000000024C0000000000000F03F0000000000002440000000000000F03F'::geometry,
 2) ) SELECT (st_dump(st_unaryunion(st_collect(geom)))).geom FROM nearby;
 DEBUG:  Split by POINT(0 0): MULTILINESTRING((-10 1,10 1))
 }}}

 So the code does realize it should _split_ the line, but fails at doing it
 because the point is not _on_ the line, a snap should fix.

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