[mapserver-users] Should "EXTENT_PRIORITY=WORLDFILE" work now?

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Fri Oct 24 09:23:49 EDT 2008


Frank Warmerdam wrote:
> Lähetetty: 21. lokakuuta 2008 17:34
> Rahkonen Jukka wrote:
> > Hi,
> > 
> > Frank Warmerdam wrote in February 2008:
> > 
> >> In have encorporated an undocumented raster layer 
> processing option 
> >> called EXTENT_PRIORITY in trunk.  Set the value to 
> WORLDFILE to use 
> >> world files in priority to internal information.
> > 
> >> eg.
> >>    PROCESSING "EXTENT_PRIORITY=WORLDFILE"
> > 
> >> This will appear in the next FWTools build since it is 
> part of trunk 
> >> (and will appear in MapServer 5.2 when released).  I'm not 
> inclined 
> >> to try and port it back into 5.0 branch.
> > 
> > I would have actual use for this feature now and I tried to use it 
> > with MS4W Mapserver v. 5.2.0 and also with the Mapserver 
> 5.3-dev that 
> > comes with FWTools 2.2.6.  However, I did not see any effect when 
> > using this PROCESSING option. I tried to use the option both for a 
> > layer having just a single tiff file and for a tileindex 
> raster layer, 
> > but extents seem to come always from internal GeoTIFF 
> information. Is 
> > the option supposed to work?
> 
> Jukka,
> 
> Yes, it should work, though looking at the code it only looks 
> for world files with the extension .wld in this case (not 
> .tfw, or .tifw).  The code
> is:
 
> If you find it does not work with .wld files, file a ticket 
> with details.
> If you feel it is particularly perverse that it requires .wld 
> instead of .tfw or .tifw (which normally work), you can file 
> a ticket on that too.

Frank,

It worked perfectly after renaming .tfw files to .wld.  Yes, it is perverse to assume that anybody would guess that WORLDFILE here means .wld instead of .tfw that is somewhat more widely used.  But it is perverse anyway to give intentionally contradictory georeferencing information in GeoTIFF tags and in world files.  For us it is a pretty nice trick because we have to work both with UTM projection and corresponding Gauss-Krüger projection with the same center meridian.  The only differencies between the projections are the place of origo and the scale factor, and now I can serve our images from the same originals either in native epsg:3067, or in epsg:2393 by using PROCESSING "EXTENT_PRIORITY=WORLDFILE".  If somebody wonders what is the advantege over just reprojecting with MapServer, in our case it is that due to local distortions in epsg:2393 this reprojection does not give accutate results. These distortions are corrected in .tfw creation process (which in this case is .wld creation process as we have learned), and magically both epsg:2393 and epsg:3067 are accurate.  I also believe that using this trick is a bit faster than letting images to be reprojected by Mapserver.

Imagery will be used for controlling Finnish farmers and I am not sure if they all wish to send their compliments to you, Frank, but I for sure do.  

-Jukka Rahkonen-


More information about the mapserver-users mailing list