[GRASSLIST:2037] Re: MrSID conversion

Richard Greenwood rich at greenwoodmap.com
Fri Dec 12 00:13:10 EST 2003


Christopher Fonnesbeck wrote:
> 
> On Dec 11, 2003, at 7:49 PM, Richard Greenwood wrote:
> 
>> At 04:42 PM 12/11/2003, you wrote:
>>
>>> Does anyone happen to know of a good conversion utility for MrSID 
>>> files so that I can import some ortho photos into GRASS? I found one 
>>> called mrsiddecode, but it doesnt use the projection information in 
>>> the header file, making it virtually useless.
>>
>>
>> Are you referring to geo-referencing information in the .sid file or 
>> in the .sdw file?  Geo-referencing information in the .sid is pretty 
>> new and I do not know of any software that reads it, but if you are 
>> referring to the .sdw 'world file', just rename it .tfw.
>>
> 
> Thanks, I tried that, but the same result. If I run gdalinfo on the 
> resultant tif file, I get:
> 
> Driver: GTiff/GeoTIFF
> Size is 10687, 14660
> Coordinate System is `'
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0,14660.0)
> Upper Right (10687.0,    0.0)
> Lower Right (10687.0,14660.0)
> Center      ( 5343.5, 7330.0)
> Band 1 Block=10687x1 Type=Byte, ColorInterp=Gray
> 
> Not very useful!
> -- 
> Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g )
> Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia
> 
That doesn't make sense to me. You have a x.tif and an x.tfw, right? 
x.tif came out of some mrsid conversion and x.tfw is the original .sdw 
renamed to x.tfw?

If my assumptions above are correct then look at the x.tfw and make sure 
it has coordinates (5th and 6th lines). And if it does, then I am 
guessing that there is a bad geo-tiff header in x.tif. Use any simple 
image processing to open, and then re-save x.tif. (By 'simple' image 
processing I mean something that doesn't try to read a geo-tiff header) 
This will remove the bad geo-tiff header in x.tif and force gdal to read 
the world file (x.tfw). At which point you should be able to do 
r.in.gdal -oe x.tif out=x

Richard




More information about the grass-user mailing list