[GRASS-dev] r.in.gdal -r and r.import extent=region not working properly?

Nikos Alexandris nik at nikosalexandris.net
Mon Apr 16 06:25:35 PDT 2018


* Markus Metz <markus.metz.giswork at gmail.com> [2018-04-16 14:00:24 +0200]:

>On Mon, Apr 16, 2018 at 12:28 PM, Nikos Alexandris <nik at nikosalexandris.net>
>wrote:
>>
>> * Markus Neteler <neteler at osgeo.org> [2018-04-15 22:49:09 +0200]:
>>
>>> On Sun, Apr 15, 2018 at 9:46 PM, Markus Neteler <neteler at osgeo.org>
>wrote:
>>>>
>>>> On Sun, Apr 15, 2018 at 8:48 PM, Veronica Andreo <veroandreo at gmail.com>
>wrote:
>>>>>
>>>>> Hi devs,
>>>>>
>>>>> I just found something odd. I have a CHIRPS tif for Africa [0], but I
>would
>>>>> only need to import Ghana, so I used r.in.gdal -r. However when I
>visualize
>>>>> the data, most of it is nodata, while the full map of Africa has data
>all
>>>>> over the continent. Then, I tried also with r.import extent=region.
>Same
>>>>> result. The only thing providing what I expected to be the right
>result (a
>>>>> subset from the full map) is importing the whole map and then using
>>>>> r.mapcalc to clip (i need the space in my hard disk)
>>>
>>>
>>> trying harder I can reproduce the issue (of course not NULL related).
>>>
>>> So, I have no clue right now why it behaves differently.
>>
>>
>> Hi,
>>
>> no intention to add noise. There is something weird, here too.
>>
>> # first things first
>> grass -c /geo/geodata/examples/chirps-v2.0.2018.01.01.tif
>/geo/grassdb/onsight/chirps
>>
>> # importing the whole map looks visually ok
>> r.in.gdal input=/geo/geodata/examples/chirps-v2.0.2018.01.01.tif
>output=chirps_v2
>>
>> # then, using the following box coordinates for Ghana from
>> # https://en.wikipedia.org/wiki/User%3aThe_Anome/country_bounding_boxes
>> g.region w=-4.000 e=4.733 n=20.000 s=11.167 -p
>
>This bbox is north of Ghana, not Ghana.
>
>>
>> # to draw the box on-display
>> v.in.region output=ghana_box
>>
>> # and doing a partial import
>> r.in.gdal -r input=/geo/geodata/examples/chirps-v2.0.2018.01.01.tif
>output=chirps_v2_subset
>>
>> Regardless whether the box figures are not correct, while the imported
>> portion is, indeed, a box fraction of the whole map, it isn't, visually
>> the "right" part. It appears as a part from the coast has been imported.
>
>Apparently you did not update your local copy of trunk or relbr74, see my
>previous post.
>
>Markus M


Early test performed with GRASS 7.5.svn (2018), libgis Revision: 72327,
libgis Date: 2018-03-06 12:12:44 +0100 (Tue, 06 Mar 2018).

Comfirmed, buggy behaviour is away using latest trunk.

Nikos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180416/edb36d06/attachment.sig>


More information about the grass-dev mailing list