Bug report #17650

segments_to_line function not respecting line orientation

Added by Zoran Čučković over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Nyall Dawson
Category:Expressions
Affected QGIS version:2.18.4 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:25547

Description

I'm having inconsistent rendering when using segments_to_lines function. The idea is to produce shaded contour lines. The procedure is as follows:

  1. 1) explode lines "on-the-fly" using
    segments_to_lines( $geometry)
  2. 2) calculate azimuth for each line
        azimuth(
            end_point(geometry_n($geometry,@geometry_part_num)),
            start_point(geometry_n($geometry,@geometry_part_num)))  

This is what happens when the result is translated to line colours:

These two screen-shots were made while panning and zooming in/out. The contour lines were made with GDAL, which is expressly tuned to respect line orientation (" Starting from version 1.7 the contour line-strings will be oriented consistently "). It seems that the routine does not respect line orientation. Or, perhaps, the azimuth value is out of range (?)

The full code of my function:

function.png (22.3 KB) Zoran Čučković, 2017-12-06 06:46 PM

view1.png (32 KB) Zoran Čučković, 2017-12-06 06:46 PM

view2.png (40.2 KB) Zoran Čučković, 2017-12-06 06:55 PM

History

#1 Updated by Zoran Čučković over 6 years ago

  • Status changed from Open to Closed

The problem was in colour ranges that I assigned to the result (in the scale_linear function).
All works fine, sorry about this !

#2 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to invalid

Also available in: Atom PDF