Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#609 closed defect (fixed)

GEOSPointOnSurface returns EMPTY for single-point linestring

Reported by: strk Owned by: geos-devel@…
Priority: major Milestone: 3.3.7
Component: Default Version: 3.3.6
Severity: Unassigned Keywords:
Cc:

Description

I would expect the single point as an answer instead.

Change History (6)

comment:1 Changed 8 years ago by strk

Problem is with CentroidLine? class intentionally refusing to give an answer for lines with no length.

comment:2 Changed 8 years ago by strk

Same with GEOSCentroid, indeed

comment:3 Changed 8 years ago by strk

So for GEOSCentroid the answer is correct, in that by definition the CentroidLine? class computes the centroid of all segment's midpoint weighted by segment length, so a zero-length segment is not considered.

Now, the algorithm of InteriorPointLine? [1] is:

  • Find an interior vertex which is closest to the centroid of the linestring.
  • If there is no interior vertex, find the endpoint which is closest to the centroid.

[1] http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/algorithm/InteriorPointLine.html

But if there's no interior vertex both endpoints are equidistant to the centroid, aren't them ? Martin: am I missing anything ?

comment:4 Changed 8 years ago by strk

Resolution: fixed
Status: newclosed

InteriorPointLine? fixed by r3739 in 3.3 branch and r3741 in trunk.

comment:5 Changed 8 years ago by strk

NOTE: JTS fixed this in another way, see revision 726 of it. It's to be evaluated if such refactoring belongs to the 3.3 branch or only in 3.4

comment:6 Changed 8 years ago by strk

See #613 for the port of JTS issue (it's actually for area)

Note: See TracTickets for help on using tickets.