On Thu, 24 Sep 2015 15:42:59 -0700 (PDT), Martin Gray wrote:
> I run QGIS 2.8.1 (Spatialite 4.1.1) and Spatialite GUI 2.0 which
> tells
> me it is using v4.3
>
> The issue I have is that the ST_OffsetCurve function has changed
> between V4.2 (maybe earlier) and V4.3 in that for 4.3 the command is
>
>> ST_OffsetCurve( geom Curve , radius Double precision )
>
> While in V4.2 the command is
>
>> ST_OffsetCurve( geom Curve , radius Double precision , LEFT_OR_RIGHT
>> INTEGER )
>
Hi Martin,
the ST_OffsetCurve() SQL function is fully based on GEOS support,
and when it was initially implemented GEOS offered an API named
GEOSSingleSidedBuffer_r() requiring both a "width" argument
(offset distance) and a "leftSide" argument intended to specify
if the offset was to be applied on the left or on the right side.
in a second time GEOS has formally deprecated the initial
GEOSSingleSidedBuffer_r() API and a brand new GEOSOffsetCurve_r()
has been introduced.
the most recent API is intended as a full replacement, and just
requires the "width" argument:
- if the "width" value is negative the left side is assumed.
- if the "width" value is positive the right side is assumed.
unhappily this very relevant change on the GEOS side passed
completely unnoticed and wasn't incorporated in spatialite
as quickly as it ought be.
during the development cycle of spatialite 4.3.0 some user
privately reported that calling ST_OffsetCurve() frequently
returned "crazy" results, and sometimes caused some unexpected
crash.
at this point I started a thorough review of the code implementing
ST_OffsetCurve(), and I finally realized that we were inadvertently
still using the bad, dangerous and officially deprecated
GEOSSingleSidedBuffer_r() API.
switching to the most recent GEOSOffsetCurve_r() caused as a
side effect the suppression of the latest argument simply because
it's now become completely useless and meaningless.
... and that's the full history about ST_OffsetCurve()
bye Sandro