Wednesday, June 25, 2008

CRS-less Geotiff hint

I'm sure many of you know this. But that's ok I'll send it out anyhow.

If you have a problem importing a Geotiff and GDAL is ok with the Geotiff, it is probably because the Geotiff
1. Too large
2. Does not have a CRS defined.

For the too large solution I will provide a separate hint for the too large issue.

First how do you tell the Geotiff has no CRS. Using GDAL you can use the command:

> gdalinfo my_geotiff.tif

The result will have the line:

Coordinate System is `'

This means there is not CRS. Suppose the correct CRS is EPSG:4326 (lat long). Use the command:

> gdalwarp -s_srs EPSG:4326 -t_srs EPSG:4326 my_geotiff.tif referenced_geotiff.tif

I'm not a gdal wizard so you may have to regenerate pyramids and so on but uDig 1.1 can use the referenced_geotiff.tif now.

Another note is that uDig 1.1 loads the tif into memory so you have to allocate uDig enough memory and also you don't need to worry about overviews and pyramids. uDig 1.2 will fix this problem.
Post a Comment