[GRASS-user] Wrong projection info after importing Geotif

Markus Neteler neteler at osgeo.org
Tue Oct 28 04:41:02 EDT 2008


On Tue, Oct 28, 2008 at 9:28 AM, Agustin Lobo <Agustin.Lobo at ija.csic.es> wrote:
> Markus, I already did use -d, I copy the output below. But
> the problem that worries me most is not that the default region
> be wrong, but that r.in.gdal gets confused and interfered by
> the default or active region while I think that the only geographic info
> that should
> matter for r.in.gdal is the one in the geotiff file,
> which is correct.
>
> $ g.region -d
> $ g.region -p
> projection: 3 (Latitude-Longitude)
> zone:       0
> datum:      wgs84
> ellipsoid:  wgs84
> north:      90N
> south:      90S
> west:       180E   <<-
> east:       180E   <<-

This is no good.
West should be 180W.

This means that the DEFAULT_WIND contains
bad data. How did you create the location (sorry I forgot).

Another magic could be to add -e to r.in.gdal below.
But it seems that the location definition is inappropriate.

Markus

> nsres:      0:14:25.153538
> ewres:      0:21:36
> rows:       749
> cols:       1000
> cells:      749000
> $ r.in.gdal input=/media/mifat32/MASTER_ICTA2007_2008/2008b/npp.tif
> output=npp
>
> GRASS_INFO_MESSAGE(18845,1): Projection of input dataset and current
> location appear to match
>
> $ g.region rast=npp
> $ g.region -p
>
> GRASS_INFO_ERROR(18874,1): region for current mapset is invalid
>
> GRASS_INFO_ERROR(18874,1): line 9: <e-w resol:  0>
>
> GRASS_INFO_ERROR(18874,1): run "g.region"
>
> Thanks,
> Agus
>
> Markus Neteler wrote:
>>
>> Agus,
>>
>> On Mon, Oct 27, 2008 at 10:17 PM, Agustin Lobo <Agustin.Lobo at ija.csic.es>
>> wrote:
>>>
>>> Markus,
>>>
>>> I made the mapset using the QGIS plugin Grass /New mapset.
>>> I'm not sure if I made something wrong or it was a problem of
>>> the plugin(I'll clarify this), but the  fact is that I ended up with
>>> this (wrong) region:
>>> ~$ g.region -p
>>>
>>> GRASS_INFO_ERROR(9537,1): region for current mapset is invalid
>>>
>>> GRASS_INFO_ERROR(9537,1): line 9: <e-w resol:  0>
>>>
>>> GRASS_INFO_ERROR(9537,1): run "g.region"
>>
>> Yes (@devs: suggest the -d flag?)
>>
>>> First problem is that I cannot fix this region as explained in
>>> http://lists.osgeo.org/pipermail/grass-user/2008-October/047198.html
>>
>> If you looks closely, there was suggested:
>>
>> g.region -d
>>
>> Did you really run that (g.region set to default region)?
>> GRASS doesn't automatically recover from a illegal
>> region setting.
>>
>> Then I suppose that it will work.
>>
>> Markus
>>
>>> Second problem is that I run r.in.gdal as I mentioned to import the file
>>> that I've put
>>> in  http://aloboaleu.googlepages.com/forMarkus
>>> and get a wrong region for the raster as well:
>>> r.in.gdal input=/media/mifat32/MASTER_ICTA2007_2008/2008b/npp.tif
>>> output=npp
>>> ~$ g.region rast=npp
>>> ~$ g.region -p
>>>
>>> GRASS_INFO_ERROR(19559,1): region for current mapset is invalid
>>>
>>> GRASS_INFO_ERROR(19559,1): line 9: <e-w resol:  0>
>>>
>>> Nevertheless, according to gdalinfo, the geotif file is correct
>>> (see my last message for the gdalinfo output).
>>>
>>>  Probably, r.in.gdal would have worked fine if the default region had
>>> been
>>> correct, but this is no the point (I think). r.in.gdal should set the
>>> region
>>> for the raster according to the geotiff settings, which are correct.
>>>
>>> So there is something wrong with r.in.gdal?
>>>
>>> Thanks for your patience!
>>>
>>> Agus
>>>
>>> Markus Neteler wrote:
>>>>
>>>> Agus,
>>>>
>>>> On Sat, Oct 25, 2008 at 10:48 AM, Agustin Lobo
>>>> <Agustin.Lobo at ija.csic.es>
>>>> wrote:
>>>>>
>>>>> Thanks Markus,
>>>>> but this should not be the correct way for r.in.gdal to work,
>>>>> should it? I mean that the default is reading the
>>>>> the geotif with its own region, which should not
>>>>> be interfered by the current region unless you use
>>>>> the -o option. Am I wrong?
>>>>
>>>> since I still don't know which steps you really did (apparently
>>>> you created the location from the GeoTIFF file?)
>>>> I don't know how to help. Maybe I just missed that.
>>>>
>>>>> Anyway, my problem for applying your solution is
>>>>> described in message
>>>>> http://lists.osgeo.org/pipermail/grass-user/2008-October/047198.html
>>>>>
>>>>> (I set up the default region using qgis
>>>>
>>>> OK, but in QGIS, what did you do to set up the default region?
>>>>
>>>>> and, by some reason, was wrong and cannot modify it)
>>>>
>>>> To reproduce it, I would need the steps in a detailed way...
>>>> (say, due to work overload I am most motivated with the
>>>> full procedure :-).
>>>>
>>>> Markus
>>>>
>>> --
>>> Dr. Agustin Lobo
>>> Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
>>> LLuis Sole Sabaris s/n
>>> 08028 Barcelona
>>> Spain
>>> Tel. 34 934095410
>>> Fax. 34 934110012
>>> email: Agustin.Lobo at ija.csic.es
>>> http://www.ija.csic.es/gt/obster
>>>
>>
>>
>>
>
> --
> Dr. Agustin Lobo
> Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
> LLuis Sole Sabaris s/n
> 08028 Barcelona
> Spain
> Tel. 34 934095410
> Fax. 34 934110012
> email: Agustin.Lobo at ija.csic.es
> http://www.ija.csic.es/gt/obster
>



-- 
Open Source Geospatial Foundation
http://www.osgeo.org/
http://www.grassbook.org/


More information about the grass-user mailing list