Hi Glynn,<br><br>Your suggestion to use r.recode was spot on. It not only avoids the mentioned limitations, it is also faster. (and it really is also much simpler).<br><br>I am still wondering about these apparent memory limitations in the r.mapcalc graph function.. but that is just curiosity, with your alternative solution, it isn't an issue for me anymore<br>
<br>Thanks<br><br>Paulo<br><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 21, 2012 at 4:28 PM, Paulo van Breugel <span dir="ltr"><<a href="mailto:p.vanbreugel@gmail.com" target="_blank">p.vanbreugel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im"><br>
<br>
On Wed 21 Nov 2012 03:39:44 PM CET, Glynn Clements wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Paulo van Breugel wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I am working with the r.mapcalc graph function. When the input (number<br>
of xy pairs) is very high, I am getting an error message:<br>
<br>
"memory exhausted<br>
Parse error<br>
ERROR: parse error"<br>
<br>
The largest possible number of xy pairs seems to be somewhere between<br>
2400 and 2500. It runs with 2400 xy pairs, and pretty fast for that<br>
matter. Memory usage doesn't go beyond 1.5GB with 2400 xy pairs, while I<br>
have 12GB RAM (on 64bit Linux computer), so I guess RAM isn't the<br>
limitation here.<br>
</blockquote>
<br>
Each "term" in an r.mapcalc expression requires a row buffer, i.e. one<br>
int/float/double value for each column of the map. A numeric literal<br>
results in a row buffer filled with that value.<br>
<br>
Depending upon what you're trying to do, it might be possible to use a<br>
combination of r.mapcalc -> r.recode -> r.mapcalc. r.recode would use<br>
significantly less memory than r.mapcalc's graph() function.<br>
</blockquote>
<br></div>
Thanks for the suggestion, I will see if I can find a way to use r.recode<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
In the help page of r.series, there is a mention of a soft limit of 1024<br>
files. Does something similar apply here (but with different numbers)?<br>
<br>
I can actually work around it, using a approximation of the graph<br>
function, but would like to know at what number of xy pairs I should<br>
apply the workaround. Particularly important, is the limit the same for<br>
all users, or if not, what would be a safe limit? Or is there a way to<br>
set this limit from within a script?<br>
</blockquote>
<br>
The limit would depend upon the number of columns in the current<br>
region and the amount of memory available.<br>
</blockquote>
<br></div>
OK, but what I find strange is that using 2400 terms uses less then 2.5 GB, I would not expect 2500 terms to use more then 12 GB (amount of RAM available) in that case.<br>
I also tried to run a r.mapcalc with 2600 terms for a map of 15 x 19 cells. Also here I got the message: "memory exhausted", which can hardly be related to lack of memory?<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
</blockquote>
</blockquote></div><br></div>