[Mapserver-users] can't display raster

Ed McNierney ed at topozone.com
Wed Feb 5 13:13:06 EST 2003


This is a multi-part message in MIME format.

------_=_NextPart_001_01C2CD42.3B609D28
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Jeff -
=20
Your world file reads:
=20
1
0
0
-1
0
0
=20
which means, "The upper-left corner of this image is at (0, 0), and =
image X coordinates increase by 1 per pixel moving to the right, and =
image Y coordinates DECREASE by 1 per pixel moving down".
=20
Therefore, if you map image is, for example, 960 pixels wide and 560 =
pixels high, all Y coordinates in the image file are negative, running =
from 0 (max) to -559 (at the bottom).  Your Y extents are all positive, =
so you won't see the image.  You need to either adjust the extents or =
the world file.  I won't guarantee that this is your ONLY problem, =
however <g>, but we should fix it first.
=20
    - Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242=20

-----Original Message-----
From: Jeff Austin [mailto:jaustin at arb.ca.gov]
Sent: Wednesday, February 05, 2003 1:05 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] can't display raster


I've been trying to display a map with a single layer - a raster image - =
but so far I'm stumped.  I'm using a tiff image with a world file.   =
Here's what I've tried so far:=20

(1) Verified that MS was compiled with tiff support.=20
(2) Made sure the tiff image is indexed, not RGB=20
(3) Fiddled with the extents in the world file=20
(4) Made sure that the image path is specified correctly=20
(5) Tried changing the "STATUS ON" statement in the layer to "STATUS =
DEFAULT"=20


Still, all I get is a blank image (just the background color) with no =
map.  I would greatly appreciate any advice folks can give.=20


Here is the text of the four relevant files, cal03_init.html, =
cal03.html, cal03.map map and cal03.wld:=20


cal03_init.html:=20


 <html>=20
 <head><title>MapServer Test Interface</title></head>=20
 <body bgcolor=3D"#FFFFFF">=20
 =20
 <center><h2>MapServer Test Interface</h2></center>=20
 <p><hr><p>=20
 This is a test=20
 =20
 <form method=3DGET action=3D"/cgi-bin/mapserv">=20
 =20
 <input type=3D"hidden" name=3D"map" =
value=3D"/var/www/html/itasca/cal03.map">=20
 <input type=3D"hidden" name=3D"layer" value=3D"raster_layer">=20
 <input type=3D"hidden" name=3D"program" value=3D"/cgi-bin/mapserv">=20
 <input type=3D"hidden" name=3D"map_web_imagepath" =
value=3D"/var/www/html/itasca/tmp/">=20
 <input type=3D"hidden" name=3D"map_web_imageurl" =
value=3D"/itasca/tmp/">=20
 <center><input type=3D"submit" value=3D"Initialize"></center>=20
 =20
 </form>=20
 =20
 <p><hr><p>=20
 =20
 </body></html>=20


cal03.html:=20


 <form method=3DGET action=3D"[program]">=20
  <INPUT NAME=3D"img" TYPE=3D"image" SRC=3D"[img]" width=3D960 =
height=3D580 border=3D1>=20
 </form>=20


cal03.map:=20


 #=20
 # Start of map file=20
 #=20
 =20
 NAME TEST=20
 STATUS ON=20
 SIZE 960 580=20
 EXTENT 0 0 960 580=20
 SHAPEPATH "test"=20
 IMAGECOLOR 0 0 0=20
 IMAGETYPE PNG=20
 =20
 WEB=20
   TEMPLATE "cal03.html"=20
   IMAGEPATH "set in cal03_init.html"=20
   IMAGEURL "set in cal03_init.html"=20
 END=20
 =20
 LAYER=20
   NAME raster_layer=20
   DATA "cal03.tif"=20
   TYPE RASTER=20
   STATUS ON=20
 END=20


 END # Map File=20


cal03.wld:=20


 1=20
 0.0=20
 0.0=20
 -1=20
 0.0=20
 0.0=20
 =20
 =20
 =20
 =20
 =20
 =20
 =20
 =20
 =20
 =20


------_=_NextPart_001_01C2CD42.3B609D28
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=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =
size=3D2>Jeff=20
-</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =
size=3D2>Your=20
world file reads:</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2>1</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2>0</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2>0</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2>-1</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2>0</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2>0</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =
size=3D2>which=20
means, "The upper-left corner of this image is at (0, 0), and image X=20
coordinates increase by 1 per pixel moving to the right, and image Y =
coordinates=20
DECREASE by 1 per pixel moving down".</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2>Therefore, if you map image is, for example, 960 pixels wide =
and 560=20
pixels high, all Y coordinates in the image file are negative, running =
from 0=20
(max) to -559 (at the bottom).&nbsp; Your Y extents are all positive, so =
you=20
won't see the image.&nbsp; You need to either adjust the extents or the =
world=20
file.&nbsp; I won't guarantee that this is your ONLY problem, however =
&lt;g&gt;,=20
but we should fix it first.</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D992171018-05022003>&nbsp;&nbsp;&nbsp; <FONT =
face=3DArial=20
color=3D#0000ff size=3D2>- Ed</FONT></SPAN></DIV>
<DIV><SPAN class=3D992171018-05022003>
<P><FONT size=3D2>Ed McNierney<BR>President and Chief =
Mapmaker<BR>TopoZone.com /=20
Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North =
Chelmsford,=20
MA&nbsp; 01863<BR>ed at topozone.com<BR>(978) 251-4242 =
</FONT></P></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> Jeff Austin=20
  [mailto:jaustin at arb.ca.gov]<BR><B>Sent:</B> Wednesday, February 05, =
2003 1:05=20
  PM<BR><B>To:</B> mapserver-users at lists.gis.umn.edu<BR><B>Subject:</B>=20
  [Mapserver-users] can't display raster<BR><BR></FONT></DIV>I've been =
trying to=20
  display a map with a single layer - a raster image - but so far I'm=20
  stumped.&nbsp; I'm using a tiff image with a world file.&nbsp;&nbsp; =
Here's=20
  what I've tried so far:=20
  <P>(1) Verified that MS was compiled with tiff support. <BR>(2) Made =
sure the=20
  tiff image is indexed, not RGB <BR>(3) Fiddled with the extents in the =
world=20
  file <BR>(4) Made sure that the image path is specified correctly =
<BR>(5)=20
  Tried changing the "STATUS ON" statement in the layer to "STATUS =
DEFAULT"=20
  <P>Still, all I get is a blank image (just the background color) with =
no=20
  map.&nbsp; I would greatly appreciate any advice folks can give.=20
  <P>Here is the text of the four relevant files, cal03_init.html, =
cal03.html,=20
  cal03.map map and cal03.wld:=20
  <P><U>cal03_init.html:</U>=20
  <P>&nbsp;&lt;html&gt; <BR>&nbsp;&lt;head&gt;&lt;title&gt;MapServer =
Test=20
  Interface&lt;/title&gt;&lt;/head&gt; <BR>&nbsp;&lt;body =
bgcolor=3D"#FFFFFF"&gt;=20
  <BR>&nbsp; <BR>&nbsp;&lt;center&gt;&lt;h2&gt;MapServer Test=20
  Interface&lt;/h2&gt;&lt;/center&gt; =
<BR>&nbsp;&lt;p&gt;&lt;hr&gt;&lt;p&gt;=20
  <BR>&nbsp;This is a test <BR>&nbsp; <BR>&nbsp;&lt;form method=3DGET=20
  action=3D"/cgi-bin/mapserv"&gt; <BR>&nbsp; <BR>&nbsp;&lt;input =
type=3D"hidden"=20
  name=3D"map" value=3D"/var/www/html/itasca/cal03.map"&gt; =
<BR>&nbsp;&lt;input=20
  type=3D"hidden" name=3D"layer" value=3D"raster_layer"&gt; =
<BR>&nbsp;&lt;input=20
  type=3D"hidden" name=3D"program" value=3D"/cgi-bin/mapserv"&gt; =
<BR>&nbsp;&lt;input=20
  type=3D"hidden" name=3D"map_web_imagepath" =
value=3D"/var/www/html/itasca/tmp/"&gt;=20
  <BR>&nbsp;&lt;input type=3D"hidden" name=3D"map_web_imageurl"=20
  value=3D"/itasca/tmp/"&gt; <BR>&nbsp;&lt;center&gt;&lt;input =
type=3D"submit"=20
  value=3D"Initialize"&gt;&lt;/center&gt; <BR>&nbsp; =
<BR>&nbsp;&lt;/form&gt;=20
  <BR>&nbsp; <BR>&nbsp;&lt;p&gt;&lt;hr&gt;&lt;p&gt; <BR>&nbsp;=20
  <BR>&nbsp;&lt;/body&gt;&lt;/html&gt;=20
  <P><U>cal03.html:</U>=20
  <P>&nbsp;&lt;form method=3DGET action=3D"[program]"&gt; <BR>&nbsp; =
&lt;INPUT=20
  NAME=3D"img" TYPE=3D"image" SRC=3D"[img]" width=3D960 height=3D580 =
border=3D1&gt;=20
  <BR>&nbsp;&lt;/form&gt;=20
  <P><U>cal03.map:</U>=20
  <P>&nbsp;# <BR>&nbsp;# Start of map file <BR>&nbsp;# <BR>&nbsp; =
<BR>&nbsp;NAME=20
  TEST <BR>&nbsp;STATUS ON <BR>&nbsp;SIZE 960 580 <BR>&nbsp;EXTENT 0 0 =
960 580=20
  <BR>&nbsp;SHAPEPATH "test" <BR>&nbsp;IMAGECOLOR 0 0 0 =
<BR>&nbsp;IMAGETYPE PNG=20
  <BR>&nbsp; <BR>&nbsp;WEB <BR>&nbsp;&nbsp; TEMPLATE "cal03.html"=20
  <BR>&nbsp;&nbsp; IMAGEPATH "set in cal03_init.html" <BR>&nbsp;&nbsp; =
IMAGEURL=20
  "set in cal03_init.html" <BR>&nbsp;END <BR>&nbsp; <BR>&nbsp;LAYER=20
  <BR>&nbsp;&nbsp; NAME raster_layer <BR>&nbsp;&nbsp; DATA "cal03.tif"=20
  <BR>&nbsp;&nbsp; TYPE RASTER <BR>&nbsp;&nbsp; STATUS ON <BR>&nbsp;END=20
  <P>&nbsp;END # Map File=20
  <P><U>cal03.wld:</U>=20
  <P>&nbsp;1 <BR>&nbsp;0.0 <BR>&nbsp;0.0 <BR>&nbsp;-1 <BR>&nbsp;0.0=20
  <BR>&nbsp;0.0 <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp;=20
  <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp;=20
</P></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C2CD42.3B609D28--



More information about the mapserver-users mailing list