Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.mapcalc: add data types info to manual #3579

Merged
merged 5 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions raster/r.mapcalc/r.mapcalc.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,32 @@ <h3>Functions</h3>
</pre></div>
Note, that the row() and col() indexing starts with 1.

<h3>Data types and their precision</h3>

There are three data types that can be used within the mapcalc expression. They
are defined with certain precision and within certain value range.

<p><div class="code"><pre>
data type precision and value range info
-------------------------------------------------------------------------------
int a 32-bit integer with a range from -2,147,483,647 to
+2,147,483,647. The value -2,147,483,648 is reserved
for NODATA
pesekon2 marked this conversation as resolved.
Show resolved Hide resolved
float a 32-bit float (Float32) with a range from -3.4E38 to
3.4E38. However, the integer precision can be only
ensured between -16,777,216 and 16,777,216. If your
raster overpasses this range, it is strongly suggested
to use the type double instead
pesekon2 marked this conversation as resolved.
Show resolved Hide resolved
double a 64-bit float (Float64) with a range from -1.79E308 to
1.79E308. It is 8 bytes, 15-17 digits precision
pesekon2 marked this conversation as resolved.
Show resolved Hide resolved
null NULL value. Refer to section "NULL support" lower
pesekon2 marked this conversation as resolved.
Show resolved Hide resolved
</pre></div>

Note that the value counter rotates when the value range is reached. E.g., if
your expression is <tt>a = int(2,147,483,648)</tt>, you will get NULL value.
For expression <tt>a = int(2,147,483,649)</tt>, you will reach the lowest value
possible instead, i.e. -2,147,483,647.
pesekon2 marked this conversation as resolved.
Show resolved Hide resolved

<h3>Floating point values in the expression</h3>

Floating point numbers are allowed in the expression. A floating point
Expand Down
Loading