[geos-devel] strange behavior with offsetCurve, resulting points get resorted

Sandro Santilli strk at keybit.net
Mon Oct 14 00:16:02 PDT 2013


Left offsets retain order, while right offsets reverse it.
This is predictable, so you can reverse after a right-offset.

Unfortunately there's no Reverse function exposed in the C-API :(
if you want to provide one it'll be welcome.

--strk;

On Mon, Oct 14, 2013 at 08:51:05AM +0200, Swen Zanon wrote:
> Hi,
> i am using GEOS (3.4.x) with PHP.
> Sometimes i get a strange resorting of the points in a linestring
> after using the offsetCurve-function.
> Here is an example:
> $geosWKTReader = new GEOSWKTReader;
> $geom = $geosWKTReader->read( "LINESTRING(350 100,250 200,400
> 200,350 100)");
> $newGeom = $geom->offsetCurve(-7.5);
> die( $newGeom->__toString() );
> the result is:
> LINESTRING (268.1066017177982 192.5, 347.9453639621833
> 112.6612377556149, 387.8647450843758 192.5, 268.1066017177982 192.5)
> i would expect something like this:
> LINESTRING (347.9453639621833 112.6612377556149,...)
> Can somebody tell me, why is it so? Or is it a bug?
> The sequence of the points is very important for me, so is there a
> possibility to  prevent this behavior? Maybe by setting a parameter?
> Greets,
> Swen


More information about the geos-devel mailing list