php mapscript not saving raster layer,image blank
Craig W
whildic3 at T8.CS.MAN.AC.UK
Thu Mar 8 08:33:27 EST 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 --------------
MAP
EXTENT -11.54 48.88 3.04 61.27
FONTSET "../chameleon/satellite/etc/fonts.txt"
IMAGECOLOR 0 0 0
IMAGETYPE JPEG
SYMBOLSET "../chameleon/satellite/etc/symbols.sym"
SHAPEPATH ""
SIZE 500 425
STATUS ON
UNITS METERS
NAME "MIMAS ASAR Alternating Polarisation 8 bit GeoTiff WCS"
DEBUG ON
#Start of web interface definition (including WCS enabling metadata)
WEB
IMAGEPATH "C:/Landm2/Inetpub/wwwroot/tmp/"
IMAGEURL "http://k/tmp/"
LOG "C:/Land2/Inetpub/wwwroot/tmp/"
END
END
OUTPUTFORMAT
NAME ECW
DRIVER "GDAL/ECW"
MIMETYPE "image/ecw"
IMAGEMODE BYTE
EXTENSION "ecw"
END
OUTPUTFORMAT
NAME GEOTIFF
DRIVER "GDAL/GTiff"
MIMETYPE "image/tiff"
IMAGEMODE BYTE
EXTENSION "tif"
END
PROJECTION
"init=epsg:27700"
END
# Start of LAYER DEFINITIONS ---------------------------------------------
LAYER # ap040808_104124_vh
NAME "ap040808_104124_vh"
#DATA "E:\radar\envisat\8_bit_tif\im\im050715_102519_pwr_fil_geo.tif"
DATA "ap040808_104124_vh_pwr_fil_geo.tif"
STATUS ON
TYPE RASTER
PROCESSING "SCALE=AUTO"
UNITS Meters
DEBUG ON
METADATA
"wcs_metadatalink" "ht.uk/"
"wcs_description" "ap040808_104124_vh"
"wcs_name" "ap040808_104124_vh"
"wcs_label" "ap040808_104124_vh"
"ows_srs" "EPSG:27700"
"ows_extent" "307912.50 594137.50 448112.50 722812.50"
"wcs_resolution" "100 100"
"wcs_bandcount" "1"
"wcs_formats" "GEOTIFF"
"wcs_nativeformat" "8-bit GeoTIF"
"wcs_rangeset_name" "ap040808_104124_vh"
"wcs_rangeset_label" "ap040808_104124_vh"
END
#TILEINDEX "im.shp"
#TILEITEM "Location"
DUMP TRUE
END #ap040808_104124_vh
LAYER # ap040808_104124_vv
NAME "ap040808_104124_vv"
DATA "E:\radar\envisat\8_bit_tif\ap\ap040808_104124_vv_pwr_fil_geo.tif"
STATUS OFF
TYPE RASTER
PROCESSING "SCALE=AUTO"
UNITS Meters
DEBUG ON
METADATA
"wcs_metadatalink" "h/"
"wcs_description" "ap040808_104124_vv"
"wcs_name" "ap040808_104124_vv"
"wcs_label" "ap040808_104124_vv"
"ows_srs" "EPSG:27700"
"ows_extent" "307912.50 594137.50 448112.50 722812.50"
"wcs_resolution" "100 100"
"wcs_bandcount" "1"
"wcs_formats" "GEOTIFF"
"wcs_nativeformat" "8-bit GeoTIF"
"wcs_rangeset_name" "ap040808_104124_vv"
"wcs_rangeset_label" "ap040808_104124_vv"
END
#TILEINDEX "im.shp"
#TILEITEM "Location"
DUMP TRUE
END #ap040808_104124_vv
# End of LAYER DEFINITIONS -------------------------------
END # end of map file/object
More information about the mapserver-users
mailing list