[postgis-tickets] [PostGIS] #2192: Add tolerance parameter to ST_Split for splitting lines by points

PostGIS trac at osgeo.org
Tue Jul 19 11:13:24 PDT 2016


#2192: Add tolerance parameter to ST_Split for splitting lines by points
--------------------------+---------------------------------------
  Reporter:  michischolz  |      Owner:  pramsey
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS Future
 Component:  postgis      |    Version:  2.0.x
Resolution:               |   Keywords:  st_split, tolerance, gsoc
--------------------------+---------------------------------------

Comment (by worthlutz):

 I ran into this problem and this ticket showed up on Google. I was a bit
 confused trying to use ST_Snap as hinted at above.  It took me a while to
 understand that I needed to snap the line to the point instead of the
 opposite.   I am adding this comment to help others.

 Here is my query:
 {{{
 SELECT
     ST_AsText( ST_LineInterpolatePoint(the_geom, 0.5) ) AS the_point_geom,

     ST_AsText(
         (ST_Dump(
             ST_Split(
                 ST_Snap( the_geom, ST_LineInterpolatePoint(the_geom, 0.5),
 0.00000001 ),
                          ST_LineInterpolatePoint(the_geom, 0.5)
             )
         )).geom
     ) AS the_new_line_geom

 FROM _rt_geom_streets_base
 WHERE id = 2085426
 }}}

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/2192#comment:6>
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-tickets mailing list