Georeferencing Mrsid raster file with a world file

Volkan Ulukut arthan at DSL.TTNET.NET.TR
Mon Nov 12 14:47:26 PST 2007


Frank
Thanks for your help. I was able to change extent of the raster with vrt
file. About my statements, I'm not a GIS expert and the only thing I did
about sid files are getting them from business partners. That's why I spoke
a little foggy I don't know with which software they did work all I know is
they were absolutly sure the extents were correctly set. 
Why I said what mapserver should do? Because I read that mapserver supports
mrsid files and world files that's why I assumed this should work. Sorry if
I sounded a little offensive. 
Thanks again vrt method works.
Regards

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Monday, November 12, 2007 4:17 PM
To: Volkan Ulukut
Cc: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Georeferencing Mrsid raster file with a
world file

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