World File problem (was Re: [GRASS-user] Re: GRASS-user] Help with
reprojection (Hamish))
Richard Chirgwin
rchirgwin at ozemail.com.au
Mon Jan 5 14:55:31 EST 2009
Markus Neteler wrote:
> On Mon, Jan 5, 2009 at 6:37 AM, rchirgwin at ozemail.com.au
> <rchirgwin at ozemail.com.au> wrote:
>
>>> Date: Sat, 3 Jan 2009 13:25:31 -0800 (PST)
>>> From: Hamish <hamish_b at yahoo.com>
>>>
>>> Hamish wrote:
>>>
>>>>> - create a simple xy location
>>>>> (lat/lon location will not allow north > 90, and your image while
>>>>> still not geo-referenced will go to 8100)
>>>>> - run r.region to set n,s,e,w bounds to 90,-90,180,-180
>>>>> - run g.setproj to rejig the location into a lat/lon one.
>>>>>
>>> umm, that might not work -- r.info will still know the map is XY even
>>> if the location is changed to lat/lon.
>>>
>>>
>>>>> - check resolution is correct (nicely "0:01:20") with r.info.
>>>>> - zoom to area of interest. you probably do not want to reproject
>>>>> entire planet. after zooming check resolution is preserved,
>>>>> (g.region -p, maybe with "g.region res=0:01:20 -a" after zoom to fix)
>>>>> and run "r.mapcalc cropmap=fullmap" to perform the crop.
>>>>>
>>>>> then from the lambert location run r.proj to pull the
>>>>> cropped image across.
>>>>>
>>>>> there are some examples of this process in the GRASS wiki,
>>>>> look at the "Global datasets" page.
>>>>>
>>> the above issue should be covered there; also check the mailing list
>>> archives.
>>>
>>> so your "easiest" solution is to create a "world file". see the GDAL
>>> JPG or GeoTiff format import page, or do a web search for instructions.
>>>
>> Grass-6.3.0 under Mac doesn't seem to be checking for the world file.
>>
>> 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.
>>
>
> We would need more details to better understand the problem.
> What does gdalinfo report on the file? (GRASS calls GDAL to read
> the files).
>
> Markus
>
>
Markus,
Here's a sample gdalinfo output:
> Driver: GTiff/GeoTIFF
> Files: Tiff_Test.tif
> Size is 4838, 3781
> Coordinate System is `'
> Origin = (150.345869440000001,-33.599355220000000)
> Pixel Size = (0.000002780000000,-0.000002780000000)
> Image Structure Metadata:
> INTERLEAVE=PIXEL
> Corner Coordinates:
> Upper Left ( 150.3458694, -33.5993552)
> Lower Left ( 150.3458694, -33.6098664)
> Upper Right ( 150.3593191, -33.5993552)
> Lower Right ( 150.3593191, -33.6098664)
> Center ( 150.3525943, -33.6046108)
> Band 1 Block=4838x1 Type=Byte, ColorInterp=Red
> Band 2 Block=4838x1 Type=Byte, ColorInterp=Green
> Band 3 Block=4838x1 Type=Byte, ColorInterp=Blue
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.
> ERROR: Projection of dataset does not appear to match current location.
>
> 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)
Cheers,
Richard
More information about the grass-user
mailing list