[mapserver-users] Problem with rasters and world files

Stepan Kafka stepan.kafka@centrum.cz
Thu, 10 Oct 2002 17:56:24 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C27086.5966C0B0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Hi James,
  you MUST specify the pixel size not number of pixels at the 1. and 4. row
of your wld file.

Stepan Kafka
Help Service Remote Sensing
tel: +420-327514118
mailto:kafka@email.cz
http://www.bnhelp.cz

  -----Puvodní zpráva-----
  Od: owner-mapserver-users@lists.gis.umn.edu
[mailto:owner-mapserver-users@lists.gis.umn.edu]za uživatele James Anderson
  Odesláno: 10. ríjna 2002 14:30
  Komu: mapserver-users@lists.gis.umn.edu
  Predmet: [mapserver-users] Problem with rasters and world files


  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.



------=_NextPart_000_0007_01C27086.5966C0B0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D945135415-10102002><FONT face=3DArial color=3D#0000ff =
size=3D2>Hi=20
James,</FONT></SPAN></DIV>
<DIV><SPAN class=3D945135415-10102002><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
you MUST specify the pixel size not number of pixels&nbsp;at the 1. and =
4. row=20
of your wld file.</FONT></SPAN></DIV>
<DIV><SPAN class=3D945135415-10102002><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D945135415-10102002><FONT color=3D#0000ff>
<P><FONT face=3DArial size=3D2><SPAN class=3D945135415-10102002>Stepan=20
Kafka<BR></SPAN></FONT><FONT face=3DArial size=3D2>Help Service Remote=20
Sensing<BR>tel: +420-327514118<BR></FONT><A =
href=3D"mailto:kafka@email.cz"=20
target=3D_blank><FONT face=3DArial =
size=3D2>mailto:kafka@email.cz</FONT></A><BR><A=20
href=3D"http://www.bnhelp.cz/" target=3D_blank><FONT face=3DArial=20
size=3D2>http://www.bnhelp.cz</FONT></A><FONT face=3DArial size=3D2>=20
</FONT></P></FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader><FONT face=3D"Times New Roman"=20
  size=3D2>-----P&#367;vodn=ED zpr=E1va-----<BR><B>Od:</B>=20
  owner-mapserver-users@lists.gis.umn.edu=20
  [mailto:owner-mapserver-users@lists.gis.umn.edu]<B>za u=9Eivatele</B> =
James=20
  Anderson<BR><B>Odesl=E1no:</B> 10. &#345;=EDjna 2002 =
14:30<BR><B>Komu:</B>=20
  mapserver-users@lists.gis.umn.edu<BR><B>P&#345;edm&#283;t:</B> =
[mapserver-users] Problem=20
  with rasters and world files<BR><BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I am a Mapserver newbie.&nbsp; Please =
Help=20
  !!</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I am trying to&nbsp;display a raster =
image of=20
  Harare.&nbsp; The raster file name is Harare.tif&nbsp;&nbsp; It is =
8bit=20
  uncompressed.&nbsp;&nbsp;13258x14646 pixels.&nbsp;&nbsp;&nbsp;I have =
made a=20
  world file called Harare.wld&nbsp;&nbsp;They are in the C:\Rasters=20
  directory</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>The world file&nbsp;</FONT><FONT =
face=3DArial=20
  size=3D2>looks like this:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial=20
  =
size=3D2>13258<BR>0.0000000000<BR>0.0000000000<BR>-14646<BR>30.873957<BR>=
</FONT><FONT=20
  face=3DArial size=3D2>-17.680917</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>The top left corner of the image is =
at 30.873957=20
  X and -17.680917 Y</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>I have made a map file Harare.map =
&nbsp;that=20
  looks like this:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>NAME EX1<BR>EXTENT -18.170 -35.000 =
54.531=20
  38.020<BR>SIZE 400 400<BR>SHAPEPATH=20
  "C:\Rasters"<BR>PROJECTION<BR>&nbsp;&nbsp;&nbsp; "proj=3Dlonglat"=20
  <BR>&nbsp;&nbsp;&nbsp; "ellps=3DWGS84" <BR>&nbsp;&nbsp;&nbsp;=20
  "datum=3DWGS84"<BR>&nbsp;&nbsp;&nbsp; "no_defs"<BR>END<BR>IMAGECOLOR =
18 23=20
  89</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>LAYER<BR>&nbsp; NAME =
"Harare"<BR>&nbsp; DATA=20
  "Harare.tif"<BR>&nbsp; TYPE RASTER<BR>&nbsp; STATUS =
ON<BR>END</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>END # end of map =
file<BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>And an html file&nbsp; default.html =
that looks=20
  like this:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>&lt;!DOCTYPE HTML PUBLIC =
"-//IETF//DTD=20
  =
HTML//EN"&gt;<BR>&lt;html&gt;<BR>&nbsp;&lt;head&gt;<BR>&nbsp;&nbsp;&lt;ti=
tle&gt;Harare=20
  Map&lt;/title&gt;<BR>&nbsp;&lt;/head&gt;<BR>&nbsp;&lt;body=20
  bgcolor=3D"#ffffff"&gt;<BR>&nbsp;&nbsp;&lt;img border=3D"1"=20
  =
src=3D"/cgi-bin/mapserv.exe?map=3DC:\Inetpub\wwwroot\map3\Harare.map&amp;=
mode=3Dmap"&gt;&lt;/p&gt;<BR>&nbsp;&lt;/body&gt;<BR>&lt;/html&gt;<BR></FO=
NT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Now I am not sure what I am doing =
wrong.&nbsp;=20
  The mapserver outputs a dark blue image, same color as the imagecolor=20
  statement in the mapfile.&nbsp; This means that the mapserver is =
working and=20
  that my file permissions are ok.&nbsp; I am running under WinXP with=20
  IIS5.1&nbsp;&nbsp; You can see my image at <A=20
  =
href=3D"http://www.thebeastie.net/map3/">http://www.thebeastie.net/map3/<=
/A></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>I think =
that&nbsp;either&nbsp;the&nbsp;extent in=20
  the mapfile is wrong or I have the world file wrong.&nbsp; I am not =
sure=20
  which.&nbsp; The example of how to make world files is not very =
clear.&nbsp;=20
  </FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Can anyone help ?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>James.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial =
size=3D2>&nbsp;</DIV></BLOCKQUOTE></FONT></BODY></HTML>

------=_NextPart_000_0007_01C27086.5966C0B0--