Opened 9 years ago
Closed 6 years ago
#2718 closed defect (wontfix)
v.mkgrid: one row lost if map extent is less than half that row size
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.7 |
Component: | Vector | Version: | svn-releasebranch70 |
Keywords: | v.mkgrid | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
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.
Attachments (1)
Change History (9)
by , 9 years ago
Attachment: | v_mkgrid_row_bug.jpg added |
---|
comment:4 by , 9 years ago
Replying to neteler:
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).
The reason is that enlarging the region can be dangerous, e.g. beyond 90N / 90S in latlong. Therefore it is saver to skip one row in the grid if that grid row would extend beyond the current regions bounds.
When setting the current region from a vector, extents and resolution should be adjusted afterwards in order to fit your needs.
Solution: add a flag to enforce full coverage using a different rounding method.
or set your current region accordingly, before running v.mkgrid.
comment:5 by , 9 years ago
Milestone: | 7.0.4 → 7.0.5 |
---|
comment:6 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:7 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:8 by , 6 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Map screenshot with indication of the row problem