[GRASS-dev] [GRASS GIS] #2649: r.to.vect diagonals defect fixed

GRASS GIS trac at osgeo.org
Mon Apr 29 21:43:42 PDT 2019


#2649: r.to.vect diagonals defect fixed
------------------------+-------------------------
  Reporter:  byronbest  |      Owner:  grass-dev@…
      Type:  defect     |     Status:  new
  Priority:  normal     |  Milestone:  7.6.2
 Component:  Raster     |    Version:  unspecified
Resolution:             |   Keywords:  r.to.vect
       CPU:  x86-64     |   Platform:  All
------------------------+-------------------------

Comment (by byronbest):

 The algorithm builds lines grid cell by grid cell, scanning over the
 entire raster row by row.
 The resulting line features have a cell value and a line segment, one or
 more grid cells long.
 Without my patch, the routine builds the vertex lists, lengthening the
 diagonal and horizontal or vertical. This is incorrect when the grid cell
 value changes-- the result will have a long line with the value of the
 last cell in the diagonal chain, instead of shorter lines with consistent
 value.
 The code is already doing runs in horizontal and vertical correctly.

 Since the grid cell centers are the vertices of the result line, the value
 is associated with the segment from grid center to grid center
 neighboring, instead of the usual value change at the grid cell edges.
 However, for miles of line in each category, this is correct.

 You may argue that the start_line should specify node=1 but since node is
 unused anyway, I used 0.
 I suspect that it is also not correct with other value types, but I only
 tested categorical data.
 The bug would show in a line feature with the entire line given the value
 (elevation) or the last point in long runs diagonally.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2649#comment:14>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list