Error drawing tiff image
Frank Broniewski
Frank.Broniewski at MNHA.ETAT.LU
Mon Oct 24 02:51:32 PDT 2005
Hello List
I have a problem with drawing a tif image. First the error message:
Error in msRASTERLayerOpen(): Attempt to open a RASTER layer,
but this is only supported after a raster query.
Error in msRASTERLayerOpen(): Attempt to open a RASTER layer,
but this is only supported after a raster query.
I searched the web for this message and found only information
concerning chameleon, which I am not using. And to be honest, I don't
understand the information I found, since they concerne some programming
aspect of mapserver. Maybe someone here can help me on a solution.
I created the image with photoshop and saved as uncompressed tiff image,
300 dpi and 24 bit color. i created a world file with ArcMap, in which
the image displays fine and on the right place.
Gdalinfo lists the following information:
c:\gdal\bin>gdalinfo "c:\karten\cds\Hansen\hansenluxsued.tif"
Driver: GTiff/GeoTIFF
Size is 10120, 8175
Coordinate System is `'
Metadata:
TIFFTAG_SOFTWARE=IMAGINE TIFF Support
Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: etif.c $ $Revision: 1.9.1.2 $ $Date: 2001/12/05
00:33:12Z
TIFFTAG_DATETIME=2005:10:17 11:47:07
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 8175.0)
Upper Right (10120.0, 0.0)
Lower Right (10120.0, 8175.0)
Center ( 5060.0, 4087.5)
Band 1 Block=10120x1 Type=Byte, ColorInterp=Red
Min=0.000/0, Max=255.000/0
Band 2 Block=10120x1 Type=Byte, ColorInterp=Green
Min=0.000/0, Max=255.000/0
Band 3 Block=10120x1 Type=Byte, ColorInterp=Blue
Min=0.000/0, Max=255.000/0
My map file for the image is as followed
MAP
NAME "Test Mapfile"
IMAGETYPE jpeg
EXTENT 42000 53000 111000 141000
SIZE 500 500
# SYMBOLSET "../symbols/symbols.sym"
SHAPEPATH "c:\karten"
IMAGECOLOR 255 255 255
WEB
IMAGEPATH "C:\mapserver\ms_tmp\"
IMAGEURL "/ms_tmp/"
END
LAYER
Debug On
Name "Topografische Karte 1910"
Data "cds/hansen/hansenluxsued2.tif"
Type Raster
Status On
END
END
As you can see, very basic and minimalistic.
My code to call the mapfile comes here
<?php
ms_ResetErrorList();
$path = 'c:\web\ms_epc\mapfiles\\';
$file = 'minimal.map';
$map = ms_newMapObj($path.$file);
$img = $map->draw();
$imgurl = $img->saveWebImage();
$error = ms_GetErrorObj();
while($error && $error->code != MS_NOERR)
{
printf("Error in %s: %s<br>\n", $error->routine,
$error->message);
$error = $error->next();
}
?>
<img src="<?php echo $imgurl; ?>">
phpinfo() gives the following information about mapserver
MapServer Version:
MapServer version 4.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG
OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ
SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
DEBUG=MSDEBUG
PHP MapScript Version:
($Revision: 1.224 $ $Date: 2005/01/28 15:28:26 $)
So what is going wrong there?
Frank Broniewski
Musée National d'Histoire et d'Art
Section Préhistoire / Projet EPC
Tél: +352 260 281-21
241, Rue de Luxembourg
L-8077 Bertrange
More information about the MapServer-users
mailing list