Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#602 closed defect (fixed)

[JTS works] GEOSOffsetCurve: IllegalArgumentException: RobustDeterminant encountered non-finite numbers

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

Description

Bug report origin: http://trac.osgeo.org/postgis/ticket/2099 Offending input (hexwkb): 010200000004000000B788150E6FB162407FABDE5E1D453AC00FB54CBB6EB162409E19426B1B453AC00FB54CBB6EB162409E19426B1B453AC033FBDBB16EB16240F24ABC1F1B453AC0 Operation: GEOSOffsetCurve(geom1_, 0, 0, GEOSBUF_JOIN_ROUND, 2);

Change History (12)

comment:1 by strk, 11 years ago

For the record: the line has a computed length of 5.58135564343909e-05 units. Here's how the WKT looks like:

LINESTRING(
 149.544806520518 -26.2699794095638,
 149.544767045802 -26.2699496303918,
 149.544767045802 -26.2699496303918,
 149.544762544299 -26.269945128889)

comment:2 by strk, 11 years ago

Possibly related: #591

comment:3 by strk, 11 years ago

Milestone: 3.3.73.3.x

comment:4 by strk, 11 years ago

NOTE: the same error occurs when passing a zero-length line to the function. Taking 5.6e-05 the same as zero may or may not be a solvable bug. I wonder if JTS survives this one.

comment:5 by mdavis, 11 years ago

This works in JTS as near as I can tell. A zero-length line works as well.

comment:6 by strk, 11 years ago

Summary: GEOSOffsetCurve: IllegalArgumentException: RobustDeterminant encountered non-finite numbers[JTS works] GEOSOffsetCurve: IllegalArgumentException: RobustDeterminant encountered non-finite numbers

MArtin: what does JTS return as an OffsetCurve from a zero-length line ?

comment:7 by mdavis, 11 years ago

The same result as if the zero-length line was a point.

comment:8 by strk, 11 years ago

The problem seems to originate in an attempt by OffsetegmentGenerator to compute the offset of a zero or close-to-zero length segment, which results in a NaN ordinate offset. I guess it could be worked around this by omitting the zero or too-short segment from the list (I'm surprised this isn't done already by the simplification step).

comment:9 by strk, 11 years ago

This is even worst, crashes the lib: LINESTRING(140 -26,149 -26.,149 -26.,149 -26)

comment:10 by strk, 11 years ago

To recap, this one throws an exception:

LINESTRING(0 1,0 2,0 2,0 0)

And this one aborts:

LINESTRING(0 1,0 2,0 2)

Pretty stable functionality ! :P

comment:11 by strk, 11 years ago

Resolution: fixed
Status: newclosed

All cases fixed with r3845 and r3846 (collapsed line) in trunk, backported as r11693 in 3.3 branch

comment:12 by strk, 11 years ago

Sorry, the backport is r3847

Note: See TracTickets for help on using tickets.