[mapserver-users] Problem with rasters and world files

Sean Gillies sgillies at frii.com
Thu Oct 10 11:57:35 EDT 2002


James,

You've simply confused 'pixel size' with 'image size'.  Instead of
'13258' in your first line you should have the number of degrees per
pixel such as '0.0002777'.

Sean

James Anderson wrote:
> Hi,
>  
> I am a Mapserver newbie.  Please Help !!
>  
> I am trying to display a raster image of Harare.  The raster file name 
> is Harare.tif   It is 8bit uncompressed.  13258x14646 pixels.   I have 
> made a world file called Harare.wld  They are in the C:\Rasters directory
> The world file looks like this:
>  
> 13258
> 0.0000000000
> 0.0000000000
> -14646
> 30.873957
> -17.680917
>  
> The top left corner of the image is at 30.873957 X and -17.680917 Y
> I have made a map file Harare.map  that looks like this:
>  
> NAME EX1
> EXTENT -18.170 -35.000 54.531 38.020
> SIZE 400 400
> SHAPEPATH "C:\Rasters"
> PROJECTION
>     "proj=longlat"
>     "ellps=WGS84"
>     "datum=WGS84"
>     "no_defs"
> END
> IMAGECOLOR 18 23 89
>  
> LAYER
>   NAME "Harare"
>   DATA "Harare.tif"
>   TYPE RASTER
>   STATUS ON
> END
>  
> END # end of map file
>  
> And an html file  default.html that looks like this:
>  
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
> <html>
>  <head>
>   <title>Harare Map</title>
>  </head>
>  <body bgcolor="#ffffff">
>   <img border="1" 
> src="/cgi-bin/mapserv.exe?map=C:\Inetpub\wwwroot\map3\Harare.map&mode=map"></p>
>  </body>
> </html>
>  
>  
> Now I am not sure what I am doing wrong.  The mapserver outputs a dark 
> blue image, same color as the imagecolor statement in the mapfile.  This 
> means that the mapserver is working and that my file permissions are 
> ok.  I am running under WinXP with IIS5.1   You can see my image at 
> http://www.thebeastie.net/map3/
> I think that either the extent in the mapfile is wrong or I have the 
> world file wrong.  I am not sure which.  The example of how to make 
> world files is not very clear. 
>  
> Can anyone help ?
>  
> Thanks,
>  
> James.
>  
>  




More information about the mapserver-users mailing list