[GRASS-user] mapcalc and cell coordinates
Michael Barton
michael.barton at asu.edu
Mon Jul 14 11:00:45 EDT 2008
On Jul 14, 2008, at 3:54 AM, <grass-user-request at lists.osgeo.org> wrote:
> Date: Mon, 14 Jul 2008 12:17:54 +0200
> From: "G. Allegri" <giohappy at gmail.com>
> Subject: Re: [GRASS-user] mapcalc and cell coordinates
> To: "Paul Kelly" <paul-grass at stjohnspoint.co.uk>
> Cc: grassuser <grass-user at lists.osgeo.org>
> Message-ID:
> <e12429640807140317p694fa9c3i1180d98711cbfc32 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Yer, but as mapcalc has some built-in functions like x() and y() to
> retrieve the x-y coordinates, I think it could be easy to trasform
> them in projected coordinates.
> I'm writing a few lines in C to solve it, but I think I'll take a look
> to r.mapcalc code to see if it would be possible to add something like
> x_coord() and y_coord()...
It would be great if you could do this. It is important to coupling
agent-based and other kinds of modeling to GIS functions in GRASS.
Michael
>
>
> 2008/7/14 Paul Kelly <paul-grass at stjohnspoint.co.uk>:
>> On Mon, 14 Jul 2008, G. Allegri wrote:
>>
>>> How can I control mapalgebra "if" statements on the base of the
>>> coordinates values of a cell?
>>> The base problem is to change the values of some specific cells on
>>> the
>>> base of their coordinates.
>>
>> I suspect this might not be possible with r.mapcalc, because each
>> variable
>> in an r.mapcalc expression is effectively an entire map and the
>> expression
>> used to generate the output map can't be changed based on the co-
>> ordinates
>> of individual cells in the input map. I.e., the same expression
>> applies to
>> each and every cell in the output map.
>>
>> That's my understanding anyway, based on an answer Glynn gave me a
>> few years
>> ago:
>> http://lists.osgeo.org/pipermail/grass-user/2003-January/008182.html
>> Does that seem relevant to your case?
>>
>> Paul
>>
>
More information about the grass-user
mailing list