Re: [QGIS-Developer] segmentSide and leftOfLine functions

2019-01-17 Thread Raymond Nijssen


Should be fixed -- looks like needless duplication to me. One of the
methods should be deprecated and tagged for removal in QGIS 4.0.

Can't leftOfLine() be removed before the 3.6 release? Hasn't been used 
too much yet, I think. Is it possible to find out who added it?


I tried git blame but I'm not much of a git guru.

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] segmentSide and leftOfLine functions

2019-01-16 Thread Nyall Dawson
On Wed, 16 Jan 2019 at 00:08, Raymond Nijssen  wrote:
>
> Since 2 months there's a new function called leftOfLine() which
> calculates if a point is left or right from a line(segment). While using
> it I wondered why:
>
> It returns
> -1 if point is on left side
> 1 if point is on right side
>
> cause I would expect the opposite result, or call the function
> rightOfLine().
>
>
>
> When diving into this, I also found the function segmentSide() which
> calculates the exact same (but having a better name).
>
>
> Here they are
>
> segmentSide:
>
> https://github.com/qgis/QGIS/blob/63a34455215d25851d648409bef9913bb0906e3f/src/core/geometry/qgsgeometryutils.cpp#L988
>
>
> leftOfLine:
>
> https://github.com/qgis/QGIS/blob/63a34455215d25851d648409bef9913bb0906e3f/src/core/geometry/qgsgeometryutils.cpp#L583
>
> Am I missing something or should this be fixed?

Should be fixed -- looks like needless duplication to me. One of the
methods should be deprecated and tagged for removal in QGIS 4.0.

(Don't deprecate the method which accepts double arguments -- we don't
want to force construction of QgsPoints if they aren't already
available)

Nyall

>
> Regards,
> Raymond
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer