[GRASS-user] Using r.mapcalc to transform '*' values to a float

Thomas Adams Thomas.Adams at noaa.gov
Wed Oct 8 08:00:50 EDT 2008


Glynn,

Thank you very much for the help; I've tried the methods you suggested 
and they work fine. The latter, using r.out.ascii, is what makes the 
most sense for me.

Thanks again,
Tom

Glynn Clements wrote:
> Thomas Adams wrote:
>
>   
>> I have a GRASS location that spans the entire U.S. I plan on 
>> re-projecting raster maps into the location from a GRASS location with a 
>> much smaller domain. When I do this, the values outside of the projected 
>> map region have a value '*' when I query the new raster outside of my 
>> area of interest using the GRASS GUI. What I need to do, ultimately, is 
>> to use r.out.ascii to write out an ascii grid that covers the full U.S. 
>> region regardless of the extent of the actual data. However, before I do 
>> this I want to use r.mapcalc to convert the '*' values (are they 
>> 'null'?) to 9.999e+20, which is a the missing value for the software 
>> that needs to ingest the ascii file output from GRASS. How do I treat 
>> the '*' values in r.mapcalc?
>>     
>
> The '*' values are nulls.
>
> You can convert them with r.mapcalc with:
>
> 	r.mapcalc 'newmap = if(isnull(oldmap),9.999e+20,oldmap)'
>
> Or you can modify the existing map in place with:
>
> 	r.null themap null=9.999e+20
>
> Or you can leave them as null but replace them in the export process
> with:
>
> 	r.out.ascii themap null=9.999e+20
>
>   


-- 
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:	thomas.adams at noaa.gov

VOICE:	937-383-0528
FAX:	937-383-0033



More information about the grass-user mailing list