php mapscript not saving raster layer,image blank
Craig W
whildic3 at T8.CS.MAN.AC.UK
Thu Mar 8 05:33:27 PST 2007
I'm having a problem with the following script, it is just returning a
black square of the map size and is not loading the raster image
(correct directories have been deleted for mail):
// Load MapScript extension
if (!extension_loaded("MapScript"))
dl('php_mapscript.'.PHP_SHLIB_SUFFIX);
//create map object
$map_file="C:/La2/Inetpub/wwwroot/phpscripts/ap_wcs8bit.map";
$map = ms_newMapObj($map_file);
$img1 = $map->prepareimage();
$layer = $map->getLayerByName("ap040808_104124_vh");
// Render the map into an image object
$layer->set("status", 1);
$layer->draw($img1);
// Save the map to an image file
$img1->saveImage("C:/Lan/Inetpub/wwwroot/tmp/worldmap.jpg", $map);
Returns the following in the browser:
msDrawRasterLayerLow(ap040808_104124_vh): entering.
Returns no errors in php.log although i get the errors:
MapServer Error in :msSHPOpenFile()
(C:/Land2/Inetpub/wwwroot/phpscripts/ap040808_104124_vh_pwr_fil_geo.tif)
MapServer Error in :msSHPOpenFile()
(C:/Lan2/Inetpub/wwwroot/phpscripts/ap040808_104124_vh_pwr_fil_geo.tif)
If I attempt to do a getExtent() on the layer.
Mapfile (some sensitive metadata taken out) is attached.
MapServer Version MapServer version 4.8.1 OUTPUT=GIF OUTPUT=PNG
OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG 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.242.2.1 $ $Date: 2006/01/18
00:37:47 $)
The layers download fine in mapserver:
http://camber.mc.man.ac.uk:8080/cgi-bin/mapserv.exe?map=..\phpscripts\ap_wcs8bit.map&SERVICE=WCS&REQUEST=GetCoverage&Coverage=ap040808_104124_vh&BBOX=307912.50,594137.50,448112.50,722812.50&CRS=EPSG:27700&RESX=100&RESY=100&FORMAT=GEOTIFF
and within chameleon.
Anyone know what is wrong with my script, its for an OGC compliant
download service.
Hopefully I've given enough information.
Thanks,
Craig Whilding
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mapfile.txt
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070308/bd175f45/attachment.txt>
More information about the MapServer-users
mailing list