[GRASS5] strange r.mapcalc results

Markus Neteler neteler at itc.it
Wed Feb 13 05:13:34 EST 2002


Dear mapcalc friends,

while preparing examples for the Spearfish data set I found
some strange (maybe not) behaviour:

Idea is to work in a small subset in Speafish DEM at 1m
resolution. The area is generated with r.in.poly:

"area.txt" contains:
A
591316.80   4926455.50
591410.25   4926482.40
591434.60   4926393.60
591341.20   4926368.70
= 1 area

Import (if someone tests this, you may want to zoom the north-west area):
g.region -pa res=1
r.in.poly in=area.txt out=area
g.copy area,MASK
r.univar elevation.dem
  [...]
  Minimum: 1120
  Maximum: 1139
  [...]

so far, so nice. Now I want to "normalize" the DEM to zero elevation
(-1200m) and substract 5 meters more (excavation for a big building).
elevation.dem is an INT map. See the very different results wether I
calculate FP or INT:

r.mapcalc elevmod="elevation.dem - 1120 - 5"
EXECUTING elevmod = ...  100%
CREATING SUPPORT FILES FOR elevmod
range: -5 14

r.mapcalc elevmod="elevation.dem - 1120.0 - 5.0"
EXECUTING elevmod = ...  100%
CREATING SUPPORT FILES FOR elevmod
range: -3 14

The 2 meters difference looks quite much to me.
Comments are welcome,

 Markus




More information about the grass-dev mailing list