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: grass-dev@…
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)

in reply to:  description comment:1 by glynn, 9 years ago

Replying to marisn:

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.

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.

comment:2 by neteler, 9 years ago

Milestone: 7.1.07.2.0

Milestone renamed

comment:3 by neteler, 8 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:4 by martinl, 8 years ago

Milestone: 7.2.17.2.2

comment:5 by martinl, 7 years ago

Milestone: 7.2.27.4.0

All enhancement tickets should be assigned to 7.4 milestone.

comment:6 by neteler, 7 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:7 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:8 by martinl, 6 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:9 by martinl, 6 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:10 by martinl, 6 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.