Georeferencing Mrsid raster file with a world file

Frank Warmerdam warmerdam at POBOX.COM
Mon Nov 12 09:17:14 EST 2007


Volkan Ulukut wrote:
> I've renamed world file and the extent is stil the same. So I assume 
> there is a native georeferencing data as you call. But the thing is the 
> dataset already has sdw file so there shouldn't be any conflict with 
> gdal. I've googled a little and find out that sdw world files are 
> recognized by gdal and wld files are recognized by mapserver so i tried 
> both and failed to change the extent.
> 
> MrSID tools change the sdw file not the embedded data I'm afraid.
> 
> I cannot change the format because of the performance issues. The file 
> that big might cause some problems.
> 
> I'm not a GIS expert but these layers work fine with GIS software which 
> means their projection and registries match. But GIS software take sdw 
> file into account. Mapserver should do that too. This is either a bug on 
> mapserver -- gdal side or I don't have a correctly configured gdal -- 
> mapserver which I doubt because I can see the raster image when I set my 
> mapfile to its extent.

Volkan,

I take exception to the statements "Mapserver should do that too." and
"This is either a bug on mapserver -- gdal side...".  The decision whether
to use the internal mrsid georeferencing or the .sdw file can be reasonably
decided either way.  Using the internal information cannot be properly
deemed a bug - just a different behavior then you would like.

I'm also curious what "GIS software" is.  MapServer and GDAL can be considered
GIS software, and any GIS software built on GDAL will exhibit the the same
behavior (GRASS, QGIS ...).   Perhaps you are using some particular other
GIS software and find that it's behavior is different?  Perhaps you should
name it instead of assuming all other GIS software in the world has the
behavior you like.

Assuming you do not have mrsid compression software (and so you cannot
just regenerate the file) another option is to use a VRT wrapper.  This
is an XML file that makes it easy to modify various metadata, and other
supporting information.  The steps would be:

1) Create the .vrt file:

   gdal_translate -of VRT your.sid your.vrt

2) Edit the VRT and modify the <Geotransform> elements to match your .sdw
    file.  Hopefully the correspondance between the six numbers in the
    geotransform and the worldfile will be obvious.

3) Modify your map file to refer to the .vrt file instead of the .sid file.

Regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the mapserver-users mailing list