[GRASSLIST:2250] Re: Importing DEMs and concatenating them

Glynn Clements glynn.clements at virgin.net
Thu Aug 2 22:37:16 EDT 2001


Rich Shepard wrote:

>   I have a 3x3 array of DEMs (each covers the area of a 7.5-minute
> topographic quad map), and I'm using r.in.gdal to translate them from SDTS
> format to GRASS-5. After the required step of exporting, changing the
> '-32766' for missing data to '0', and re-importing, the maps show up in
> their proper relative position in a region that encompasses all 9 maps.
> 
>   However, when I try to use r.patch to staple them together and display the
> resulting map, all I see is the first one in the input list with the white
> background masking the others (if they're there).
> 
>   Perhaps the problem is that I'm not sure how NULL (no data) is represented
> in GRASS-5. Is it the asterisk I see in the exported ASCII files? According
> to the r.patch man page, the second (and later) input files attempt to
> replace NULL value with actual values; if the SDTS NULL value of -32766 is
> replaced with 0, then of course, r.patch won't work.
> 
>   Correct?

It depends; if the -z flag is used, both zero and NULL are
"transparent", otherwise only NULL is transparent.

NB: Rather than modifying the DEMs, I would have imported the DEMs
as-is, then used

	r.mapcalc "out = if(in == -32766, null(), in)"

to replace -32766 with NULL.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list