[geos-devel] Re: [GEOS] #323: A point interpolated from a line does not always intersect the same line

GEOS geos-trac at osgeo.org
Sun Jan 31 00:23:31 EST 2010

#323: A point interpolated from a line does not always intersect the same line
 Reporter:  starsareblue  |        Owner:  geos-devel at lists.osgeo.org
     Type:  defect        |       Status:  reopened                  
 Priority:  major         |    Milestone:                            
Component:  Default       |      Version:  3.2.0                     
 Severity:  Unassigned    |   Resolution:                            
 Keywords:                |  
Comment (by starsareblue):

 The interpolate and project methods correspond to the linear referencing
 methods in the GEOS 3.2 API.  You can see similar strange behavior in the
 GeoDjango package ( http://code.djangoproject.com/attachment/ticket/11948/
 contrib-gis-linearref.patch ) so I assumed the problem had to do with GEOS

 Here is another example.  The first interpolation is correct.  However,
 the second interpolation is wrong.  It looks like some kind of wraparound
 is happening incompletely for the edge case when the interpolation result
 for a MultiLineString happens on the endpoint of one of its LineStrings.

 In [1]: import shapely.geometry as g

 In [2]: m = g.MultiLineString([[(0, -2), (0, 2)], [(-2, 0), (2, 0)]])

 In [3]: m.interpolate(m.project(g.Point(2,1.9))).wkt    # Correct
 Out[3]: 'POINT (2.0000000000000000 0.0000000000000000)'

 In [4]: m.interpolate(m.project(g.Point(2,2.1))).wkt    # Wrong
 Out[4]: 'POINT (-2.0000000000000000 0.0000000000000000)'

 Roy Hyunjin Han
 Empowering people to create since 2008

Ticket URL: <http://trac.osgeo.org/geos/ticket/323#comment:4>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

More information about the geos-devel mailing list