Opened 9 years ago
Last modified 6 years ago
#2877 new enhancement
r.mapcalc allow neigbourhood modifier to accept expression or NAME
Reported by: | marisn | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.6.2 |
Component: | Raster | Version: | svn-trunk |
Keywords: | r.mapcalc | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
It seems that r.mapcalc map[row,col] accepts only integers as row and col. It would be useful (in rare cases) to specify row or col as an expression or name that results in integer.
Here are some examples that should work:
map[-1, ncols() - 1] map[sampler_x_map, sampler_y_map]
Change History (10)
comment:1 by , 9 years ago
comment:4 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:5 by , 7 years ago
Milestone: | 7.2.2 → 7.4.0 |
---|
All enhancement tickets should be assigned to 7.4 milestone.
comment:7 by , 6 years ago
Milestone: | 7.4.1 → 7.4.2 |
---|
comment:8 by , 6 years ago
Milestone: | 7.4.2 → 7.6.0 |
---|
All enhancement tickets should be assigned to 7.6 milestone.
Note:
See TracTickets
for help on using tickets.
Replying to marisn:
Arbitrary offsets for the column are probably feasible, but still likely to involve a fair amount of work.
Arbitrary offsets for the rows aren't feasible without a complete re-write due to the row-by-row nature of r.mapcalc. Even with such a re-write, they could require storing a significant portion of the map (possibly all of it) in memory (if the row offset is different for each column, then you need as many rows in memory as there are columns).
In that situation, you may as well use grass.script.array (or similar) to make the map available as a numpy array and get the benefits of using a real programming language.