[GRASS-user] imported .tif maps lose all data

Moritz Lennert mlennert at club.worldonline.be
Sat Sep 25 16:19:45 PDT 2021



Le 26 septembre 2021 00:50:13 GMT+02:00, Rich Shepard <rshepard at appl-ecosys.com> a écrit :
>On Sat, 25 Sep 2021, Helmut Kudrnovsky wrote:
>
>> try the same steps as I've done (with adjusted paths) and _post the
>> command and the command output_ here.
>> - g.region -p
>> - r.in.gdal input=columbia_2010_e_dtm_35.tif output=columbia_2010_e_dtm_35
>> - g.region -p -a raster=columbia_2010_e_dtm_35 align=columbia_2010_e_dtm_35
>> - r.stats -l input=columbia_2010_e_dtm_35
>> - r.report map=columbia_2010_e_dtm_35
>
>Helmut,
>
>Results in attached 574 line file. There are some cells with data, but most
>without data (82%).
>
>I can display the data with cells; for this one map they appear to cover
>only the river and not the terrain north of it. But, this is only one of 77
>files.
>
>Since this test worked I need to figure out why it didn't work when I
>imported all 77 .tif files using the bash script. Ah! Thought: when
>r.in.gdal imports all 77 files where does GRASS get the values for setting
>g.region -p?

You feed the information to g.region with the 'raster' parameter.

-p just means pretty print the region settings, it doesn't set the region.


>
>If g.region -p displays the region of last map imported then the other 76
>maps will be outside that region. Is there a module that uses all maps in
>that mapset to set the region, or is that supposed to be done by default?

If you want to set the region to the extension covered by multiple raster maps, just feed all the maps' names to the 'raster' parameter.

But in your case, while still testing, you should set the region to one map, then test with r.report, then set the region to the next map, test, etc.

Another hint: if you just want to quickly test if the imported map has any values, use r.info which is region independent. With the -r flage you get the min-max range.

Moritz


More information about the grass-user mailing list