[mapserver-users] mapserver / gdal draw failure

Aaron Sims apsims at ncsu.edu
Thu Feb 23 07:05:46 PST 2012


We are using an openlayers frontend to utilize mapserver via 
phpmapscript to read some colorized tif files we have made, and then 
render a png file on a webpage via gdal.This process seems to work about 
95% of the time, The other 5%, we are getting no images and errors 
kicked out to the httpd error log. Based on the errors below, it seems 
to be occurring when mapserver issues the $map->draw() command, and 
kicks out some GDAL errors.When this happens, there is no png image that 
gets created. Ive included the following directives in the map file to 
help with debugging CONFIG "CPL_DEBUG" "ON", andCONFIG "MS_ERRORFILE" = 
/home/logfile
Any help on what may be happening here?

*When it succeeds I see a message like this in the httpd error logs:***
GDAL: GDALOpen(/home/cache/2012021913-2012022013.tif, 
this=0x2b5e6a5abda0) succeeds as GTiff

*When it fails, I see a string of errors, such as:***
GDAL: GDALClose(/home/cache/2012021913-2012022013.tif, this=0x2b5e6fd12890)
[Mon Feb 20 14:41:18 2012] [error] [client xxx.xxx.xxx.xxx] PHP 
Warning:[MapServer Error]: msDrawMap(): Failed to draw layer named 
'map_data'.\n in /home/www/testmscross.php on line 231
[Mon Feb 20 14:41:18 2012] [error] [client xxx.xxx.xxx.xxx] PHP 
Warning:[MapServer Error]: GetBlockRef failed at X block offset 0, Y 
block offset 0: GDALDatasetRasterIO() failed: drawGDAL()\n in 
/home/www/testmscross.php on line 231
[Mon Feb 20 14:41:18 2012] [error] [client xxx.xxx.xxx.xxx] PHP 
Warning:[MapServer Error]: msDrawMap(): Failed to draw layer named 
'map_data'.\n in /home/www/testmscross.php on line 231
[Mon Feb 20 14:41:18 2012] [error] [client xxx.xxx.xxx.xxx] PHP 
Warning:[MapServer Error]: GetBlockRef failed at X block offset 0, Y 
block offset 0: GDALDatasetRasterIO() failed: drawGDAL()\n in 
/home/www/testmscross.php on line 231
[Mon Feb 20 14:41:18 2012] [error] [client xxx.xxx.xxx.xxx] PHP Fatal 
error:Call to a member function saveImage() on a non-object in 
/home/www/testmscross.php on line 270

*gdalinfo on the tiff files yields**:*
Driver: GTiff/GeoTIFFC
Files: /home/cache/2012021913-2012022013.tif
Size is 181, 132
Coordinate System is `'
Origin = (2172891.879999999888241,-5178906.330000000074506)
Pixel Size = (4772.703535911604376,-4764.676212121210483)
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left( 2172891.880,-5178906.330)
Lower Left( 2172891.880,-5807843.590)
Upper Right ( 3036751.220,-5178906.330)
Lower Right ( 3036751.220,-5807843.590)
Center( 2604821.550,-5493374.960)
Band 1 Block=181x15 Type=Byte, ColorInterp=Red
NoData Value=-1
Band 2 Block=181x15 Type=Byte, ColorInterp=Green
NoData Value=-1
Band 3 Block=181x15 Type=Byte, ColorInterp=Blue
NoData Value=-1

*and mapserv -v yields:***
MapServer version 5.6.7 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV 
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=THREADS INPUT=EPPL7 
INPUT=OGR INPUT=GDAL INPUT=MYGIS INPUT=SHAPEFILE

*Mapserver compiled with:***
./configure --with-zlib --with-png --with-jpeg --with-gd --with-proj 
--with-threads --with-ogr=/usr/local/gdal-config 
--with-gdal=/usr/local/gdal-config --with-tiff --with-mygis --with-wfs 
--with-wcs --with-wmsclient --with-wfsclient 
--with-httpd=/usr/sbin/httpd --with-php=/usr/include/php

*gdal information:***
[root]#./gdal-config --version
1.7.3

[root]# ./gdal-config --dep-libs --version
-L/usr/local/lib -lgeos_c -L/usr/lib -lsqlite3 -L/usr/lib64 
-L/usr/lib64/lib -lodbc -lodbcinst -L/usr/lib64 -L/usr/lib64/lib -lgif 
-L/usr/lib64 -L/usr/lib64/lib -ljpeg -L/usr/lib64/lib -ltiff 
-L/usr/lib64 -L/usr/lib64/lib -lpng -L/usr/local/ -L/usr/local//lib 
-lnetcdf -L/usr/local/lib -L/usr/local/lib/lib -lcfitsio -lz 
-L/usr/lib64/ -L/usr/lib64//lib -lm -lrt -ldl -L/usr/kerberos/lib64 
-lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl 
-lcrypto -lz -rdynamic -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt 
-lnsl -lm -L/usr/lib64 -lssl --lcrypto

[root]# ./gdal-config --formats
gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm sdts raw dted mem 
jdem envisat elas fit vrt usgsdem l1b nitf bmp pcidsk airsar rs2 ilwis 
rmf leveller sgi srtmhgt idrisi gsg ingr ers jaxapalsar dimap gff cosar 
pds adrg coasp tsx terragen blx msgn til r northwood saga wcs wms grib 
bsb gif jpeg png netcdf pcraster fits rik rasterlite
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120223/48a201f1/attachment.htm>


More information about the MapServer-users mailing list