Hello all,
I would like to use r.mapcalc to fill the null cells of one raster with the
value of the same cells from in a second raster (while leaving all other cells
as they are in the first raster).
Clearly I am having some kind of brain frizz because this should be simple but
I can't get it
Thus spake Rebecca Bennett (rabenn...@ymail.com):
> I would like to use r.mapcalc to fill the null cells of one raster
> with the value of the same cells from in a second raster (while
> leaving all other cells as they are in the first raster).
rasterA="if(isnull(rasterA), rasterB, rasterA)"
--
just the ticket - thank you Hendrik!
>
>From: Hendrik Hoeth
>To: Rebecca Bennett
>Cc: grass-user@lists.osgeo.org
>Sent: Monday, 25 July 2011, 22:24
>Subject: Re: [GRASS-user] mapcalc
>
>Thus spake Rebecca Bennett (rabenn...@ymail.com):
Unless there is a specific reason to use r.mapcalc I would suggest to
use r.patch
On 07/25/2011 11:20 PM, Rebecca Bennett wrote:
Hello all,
I would like to use r.mapcalc to fill the null cells of one raster
with the value of the same cells from in a second raster (while
leaving all other ce
Hi
I have the following problem: I have the following formula from
http://grass.osgeo.org/gdp/raster/mapcalc-algebra.pdf on page 12.
wasser = wasser+eval(x=elev+wasser,\
if(x>(y=elev[-1,0]+wasser[-1,0]),\
-.15*if(elev>y,wasser,x-y),\
.15*if(elev[-1,0]>x,wasser[-1,0],y-x))+\
if(x>(y=elev[1,0]+wa
Hi
I (in cooperation with Ernst Lobsiger) found a working formula for my
problem:
water=water+eval(o=4.0, s=0.15, d=0.10, x=elev+water,\
if (x>(y=elev[-1,0]+water[-1,0]) && x>o,\
-s * min(water,x-y))+\
if (y>x && y>o,\
s * min(water[-1,0],y-x))+\
..
Thanks anyway and best regards
Martin
Hello,
I have no time to look into this issue right now. Please add a wish
ticket to trac "r.lake should support minimum water column depth" and
describe how it should work.
Thanks,
Maris.
2009/10/19, Martin Schweizer :
> Hi
>
> I have the following problem: I have the following formula from
> h
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've tried using d.rast.edit but it seems a little "contorted" to me,
having to specify so many parameters
Hi,
I was wondering if anyone is using Load/Save expressions in r.mapcalc GUI.
I just added there the copy button which is standard for all modules. When
I need, I store multiple r.mapcalc commands in a text file and then I just
copy and paste. Loading and saving expressions using the buttons seem
Hi
I would like to use mapcalc with types of input a DEM (raster) and xyz
property (vector). basically, I would like to do a weighted average of
data points located for 10 m from DEM, then 10 to 20 etc.
___
grass-user mailing list
grass-user@lists.osgeo
Hello,
I am running GRASS GIS 6.5 and want to run a python script
including a mapcaluculator-expression of a simple formula:
A=if(B,C)
grass.mapcalc("$upstream_shreve = if(${upstream_part},${shreve})",
upstream_shreve = options['upstream_shreve'],
upstream_par
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 ea
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 someth
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.
r.mapcalc "$outmap = if(abs(x() - $x) < $eps && abs(y() - $y) <
$eps,$newval,
On 14/07/08 12:17, G. Allegri wrote:
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 se
> r.mapcalc brol3=if(y()<=9521600 && x()<=427000,1,null())
>
> but this doesn't:
>
> r.mapcalc brol3=if(y()==9521600 && x()==427000,1,null())
>
> which raises the issue of precision of the coordinates...
So, it's possible to check above a range of coordinates but not on a
specific one...
But I don
Moritz Lennert wrote:
> Well, this works:
>
> r.mapcalc brol3=if(y()<=9521600 && x()<=427000,1,null())
>
> but this doesn't:
>
> r.mapcalc brol3=if(y()==9521600 && x()==427000,1,null())
>
> which raises the issue of precision of the coordinates...
What are the region settings? Bear in mind t
Thanks Glynn. Exaustive explanation :-)
So I just need to check if the difference abs($x-x()) is lower then
half the resolution...
2008/7/14 Glynn Clements <[EMAIL PROTECTED]>:
>
> Moritz Lennert wrote:
>
>> Well, this works:
>>
>> r.mapcalc brol3=if(y()<=9521600 && x()<=427000,1,null())
>>
>> but
On Jul 14, 2008, at 3:54 AM, <[EMAIL PROTECTED]> wrote:
Date: Mon, 14 Jul 2008 12:17:54 +0200
From: "G. Allegri" <[EMAIL PROTECTED]>
Subject: Re: [GRASS-user] mapcalc and cell coordinates
To: "Paul Kelly" <[EMAIL PROTECTED]>
Cc: grassuser
Message-ID:
On 14/07/08 15:14, Glynn Clements wrote:
Moritz Lennert wrote:
Well, this works:
r.mapcalc brol3=if(y()<=9521600 && x()<=427000,1,null())
but this doesn't:
r.mapcalc brol3=if(y()==9521600 && x()==427000,1,null())
which raises the issue of precision of the coordinates...
What are the regio
Moritz Lennert wrote:
> > Also note that the calculation involves multiplying by the resolution.
>
> You mean internally by mapcalc, or that I should include resolution into
> the calculation ?
Internally.
The point is that if you have e.g. a 100m x 100m square, and you set
rows = cols = 300
G. Allegri wrote:
> Thanks Glynn. Exaustive explanation :-)
> So I just need to check if the difference abs($x-x()) is lower then
> half the resolution...
In hindsight:
If you want to test for the specific cell in which the given
coordinates lie, you may be better off converting the coordinates
> If you want to test for the specific cell in which the given
> coordinates lie, you may be better off converting the coordinates to a
> row/col based upon the region settings, then testing against the
> results of row() and col() (but note: row() and col() are 1-based, not
> 0-based).
>
> Testing
G. Allegri wrote:
> > If you want to test for the specific cell in which the given
> > coordinates lie, you may be better off converting the coordinates to a
> > row/col based upon the region settings, then testing against the
> > results of row() and col() (but note: row() and col() are 1-based,
Ok, Glynn. I'll adopt this way.
> bash doesn't do floating-point, so you need to use bc or awk, e.g.:
Yes, ok, I know it. It was just a "pseduo-code" :-)
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gras
Hi Anna,
that is great, I was just about to request for a "copy" button for
r.mapcalc similar to all other modules. Thanks, just what I needed. I'll
try it out in near future.
best regards,
Johannes
On Sun, Mar 30, 2014 at 12:04 AM, Anna Petrášová wrote:
> Hi,
>
> I was wondering if anyone is
You will most likely have to convert the points to raster. But
before that, can you explain what you mean by "located for 10 m
from DEM", "10 to 20".
On 08/05/2019 13:31, Francois Chartier
wrote:
Hi
I
On 8/05/19 14:00, Micha Silver wrote:
You will most likely have to convert the points to raster. But before
that, can you explain what you mean by "located for 10 m from DEM", "10
to 20".
Or, if you mean zones of equal height, you can transform them to vector
polygons and use v.vect.stats on
Hi Micha,
I have soil samples from boreholes where i have data points at every meter
interval and where soil type changes. i would like to create a weighted
average of soil property for lets say the first 1 m below the DEM, so that
i can evaluate potential for infiltration across a watershed.
On
On 8/05/19 15:03, Francois Chartier wrote:
Hi Micha,
I have soil samples from boreholes where i have data points at every
meter interval and where soil type changes. i would like to create a
weighted average of soil property for lets say the first 1 m below the
DEM, so that i can evaluate po
On 08/05/2019 16:10, Moritz Lennert
wrote:
On
8/05/19 15:03, Francois Chartier wrote:
Hi Micha,
I have soil samples from boreholes where i have data points at
every meter interval and where soil type changes. i wou
sure i will send that later. thks
On Thu., May 9, 2019, 04:00 Micha Silver, wrote:
>
> On 08/05/2019 16:10, Moritz Lennert wrote:
>
> On 8/05/19 15:03, Francois Chartier wrote:
>
> Hi Micha,
>
> I have soil samples from boreholes where i have data points at every meter
> interval and where soil
Location:Toronto |
| Database:C:\Users\hello\Documents\grassdata
|
| Title:
|
| Map scale: 1:1
|
| Name of creator: hello
|
| Organization:
|
| Source date: Thu May 09 19:17:57 2019
|
| Timestamp (firs
OK, please clarify what each column reprepsents.
On 10/05/2019 5:25, Francois Chartier
wrote:
V.DB.SELECT
c
Sorry i realised later that in my current table i didnt rename the columns.
here are the extract from excel (300 K pts).
i am using the TopDepthRasterDEM_MASL as the Z elevation, and the attribute
i am interested in are Texture in mm and K in m/sec
BHID Zone EAST83 NORTH83 GTADEM MAT1 BOTDepthRast
On 11/05/2019 3:16, Francois Chartier
wrote:
Sorry i realised later that in my current table i
didnt rename the columns. here are the extract from excel (300 K
pts).
i am using the TopDepthRasterDEM_MASL as the Z elevation,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 02/01/2011 03:28 PM, Johannes Radinger wrote:
> Hello,
>
> I am running GRASS GIS 6.5 and want to run a python script
> including a mapcaluculator-expression of a simple formula:
>
> A=if(B,C)
>
> grass.mapcalc("$upstream_shreve = if(${upstream_p
Johannes Radinger wrote:
> I am running GRASS GIS 6.5 and want to run a python script
> including a mapcaluculator-expression of a simple formula:
>
> A=if(B,C)
>
> grass.mapcalc("$upstream_shreve = if(${upstream_part},${shreve})",
> upstream_shreve = options['upstream_shreve'
Hello again,
just to give you some more information on my problem:
I am running exactly following script:
---
import sys
import os
import atexit
import grass.script as grass
import grass.script.setup as gsetup
# set mapset/location/dba
Johannes Radinger wrote:
> Somehow I didn't your answer via email, I just found it at
> http://permalink.gmane.org/gmane.comp.gis.grass.user/38530
For whatever reason, GMX doesn't like my IP address, and bounces my
emails. The problem is compounded by a "feature" of the mailing list
software whi
Glynn Clements wrote:
> > Somehow I didn't your answer via email, I just found it at
> > http://permalink.gmane.org/gmane.comp.gis.grass.user/38530
>
> For whatever reason, GMX doesn't like my IP address, and bounces my
> emails.
... so there's not much point in emailing me off-list, as I canno
Hey,
Original-Nachricht
> Datum: Fri, 4 Feb 2011 00:10:16 +
> Von: Glynn Clements
> An: grass-user@lists.osgeo.org
> Betreff: Re: [GRASS-user] mapcalc problem in python script!!
>
> Johannes Radinger wrote:
>
> > Somehow I didn't your answ
Johannes Radinger wrote:
> > > Somehow I didn't your answer via email, I just found it at
> > > http://permalink.gmane.org/gmane.comp.gis.grass.user/38530
> >
> > For whatever reason, GMX doesn't like my IP address, and bounces my
> > emails. The problem is compounded by a "feature" of the maili
Original-Nachricht
> Datum: Wed, 9 Feb 2011 01:37:43 +
> Von: Glynn Clements
> An:
> CC: grass-user@lists.osgeo.org
> Betreff: Re: [GRASS-user] mapcalc problem in python script!!
>
> Johannes Radinger wrote:
>
> > > > Somehow I didn
Johannes Radinger wrote:
> how should I proceed, how can I test if the variables are set correctly?
Add some "print" statements to the script.
--
Glynn Clements
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/li
Dear GRASS-Users,
I have a map of local elevation that I would like to alter the values of and
re-class as a experiment to aid visualisation & interpretation.
1) Currently the cells are floating point with z-values like 0.0151666768416021
- I would like to do is round the elevation values to 2
Rebecca wrote:
> I have a map of local elevation that I would like to alter the
> values of and re-class as a experiment to aid visualisation &
> interpretation.
firstly, the r.reclass module might help, as may r.contour.
> 1) Currently the cells are floating point with z-values like
> 0.01516667
Hamish wrote:
> there are a couple ways to do it, here's one:
> r.mapcalc "map.2dp = int(0.5 + (map.15g * 100))/100.0"
>
> the 0.5 is added because int() truncates instead of
> rounding.
mind that if your values go negative, int() and floor() are
not the same..
> another common way is with log
Hamish wrote:
> there are a couple ways to do it, here's one:
> r.mapcalc "map.2dp = int(0.5 + (map.15g * 100))/100.0"
>
> the 0.5 is added because int() truncates instead of rounding.
Note that r.mapcalc has a round() function.
--
Glynn Clements
___
Hi,
On Fri, Feb 15, 2013 at 2:09 PM, Glynn Clements wrote:
>
> Hamish wrote:
>
> > there are a couple ways to do it, here's one:
> > r.mapcalc "map.2dp = int(0.5 + (map.15g * 100))/100.0"
> >
> > the 0.5 is added because int() truncates instead of rounding.
>
> Note that r.mapcalc has a round()
>
> On 02/01/2011 03:28 PM, Johannes Radinger wrote:
> > Hello,
> >
> > I am running GRASS GIS 6.5 and want to run a python script
> > including a mapcaluculator-expression of a simple formula:
> >
> > A=if(B,C)
> >
> > grass.mapcalc("$upstream_shreve = if(${upstream_part},${shreve})",
> >
Hello Grass users,
I have a (hopefully) quick question - I would like to replace all values in a
raster that fall in the range -0.01 to 0.01 (i.e. 0.01><-0.01) with 0 but can't
quite work out how to express this in mapcalc.
Can anyone set me on the right track?
Thanks for reading,
Rebecca
__
r.mapcalc "new_raster=if(old_raster>-0.01 && old_raster<0.01,0,old_raster)"
Cheers,
Marcello.
On Wed, Jul 13, 2011 at 10:10 AM, Rebecca Bennett wrote:
> Hello Grass users,
>
> I have a (hopefully) quick question - I would like to replace all values in
> a raster that fall in the range -0.01 to
Or maybe you can use r.null:
r.null map=YourRASTER setnull=-0.1-0.1 null=0
On Wed, 2011-07-13 at 14:10 +0100, Rebecca Bennett wrote:
> Hello Grass users,
>
> I have a (hopefully) quick question - I would like to replace all
> values in a raster that fall in the range -0.01 to 0.01 (i.e.
> 0.01>
.@lists.osgeo.org wrote:
> Date: Wed, 13 Jul 2011 14:10:38 +0100 (BST)
> From: Rebecca Bennett
> Subject: [GRASS-user] Mapcalc to replace a range of values
> To: grass-user@lists.osgeo.org
> Message-ID: <1310562638.15878.yahoomai...@web28412.mail.ukl.yahoo.com>
> Content-Typ
Thank you to Marcello, Saber and Michael - both the r.mapcalc and r.null
methods
proposed worked a treat :)
best,
Rebecca
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
56 matches
Mail list logo