World File problem (was Re: [GRASS-user] Re: GRASS-user] Help with reprojection (Hamish))

Markus Neteler neteler at osgeo.org
Mon Jan 5 15:22:31 EST 2009


Richard,

On Mon, Jan 5, 2009 at 8:55 PM, Richard Chirgwin
<rchirgwin at ozemail.com.au> wrote:
...
>>> Grass-6.3.0 under Mac doesn't seem to be checking for the world file.

It does - see below:

>>> My test:
>>>
>>> 1) Export a raster using r.out.tiff with the "create world file" box checked
>>> 2) Check the output folder:
>>>
>>> test.tiff
>>> test.tfw
>>>
>>> 3) Import using r.in.gdal:
>>>
>>> r.in.gdal input=test.tiff output=test_2
>>>
>>> In mine, this produces a projection mismatch error - which seems to tell me
>>> that Grass isn't noticing the tfw file.

No, that's not the message :) See below:

...
> Here's a sample gdalinfo output:
>
>> Driver: GTiff/GeoTIFF
>> Files: Tiff_Test.tif
>> Size is 4838, 3781
>> Coordinate System is `'

-> the Coordinate System is (naturally) missing. Why? Because
in the .tfw file it is not stored. It might be an additional .prj file
(not sure if GDAL would recognize that, maybe yes).

...
> The world file:
>>                    0.000002780000000
>>                    0.000000000000000
>>                    0.000000000000000
>>                   -0.000002780000000
>>                  150.345870829999996
>>                  -33.599356610000001
> This file and the world file are the only items in the folder, and were
> created by r.out.tiff from a raster in  a working location.

Right.

>> ERROR: Projection of dataset does not appear to match current location.

Correct message because GRASS/GDAL cannot guess the projection
of the TIFF (since it is not specified).

>>        Location PROJ_INFO is:
>>        name: Lat/Lon
>>        proj: ll
>>        datum: wgs84
>>        ellps: wgs84
>>        no_defs: defined
>>
>>        Import dataset PROJ_INFO is:
>>        cellhd.proj = 0 (unreferenced/unknown)

GRASS is right: the  PROJ_INFO is undefined. Just a human will recognize
that it may be LatLong.

Solution: use r.in.gdal -o to disable the test and import into a location
with correct projection. Then the map will be placed correctly.

Cheers
Markus


More information about the grass-user mailing list