#2718: v.mkgrid: one row lost if map extent is less than half that row size
-------------------------+---------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.2
Component: Vector | Version: svn-releasebranch70
Keywords: v.mkgrid | CPU: Unspecified
Platform: Unspecified |
-------------------------+---------------------------------
When creating a grid and the map extent does not reach more than half of a
row size, the resulting grid is one row too small (see screenshot).
{{{
# NC data
g.region vector=zipcodes_wake -p
v.mkgrid map=grid_10km box=10000,10000
d.vect -c zipcodes_wake
d.vect grid_10km type=boundary
}}}
The issue is likely the rounding in line 329 of mainc.:
{{{
if ((int)(grid_info.num_vect_rows / 2.0 + 0.5) !=
grid_info.num_rows)
}}}
or the code closeby.
Solution: add a flag to enforce full coverage using a different rounding
method.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2718>
GRASS GIS <http://grass.osgeo.org>