[Mapserver-dev] $oLayer->getShape() broken in cvs php_mapscript

Daniel Morissette morissette at dmsolutions.ca
Tue Apr 29 12:27:14 EDT 2003

I have run into this as well and fixed it in CVS a few minutes ago.  

(It was not specific to PHP MapScript, it was caused by a change made a
few days ago to not trim leading spaces in DBF fields, so any attempt to
access shapefiles/DBFs to draw a map would have crashed as well.)


Vincent Schut wrote:
> Hi all,
> I've just cvs-updated mapserver (and updated gd to 2.0.12) and now I get a
> 'premature end of script headers' (of php) when I have a
> $oLayer->getShape(-1, $index) in my script. Which I have and pretty much rely
> on to generate classes/color ramps on the fly... This has been introduced
> after updating mapserver (just one hour ago); before that, it just worked. If
> I use a php script without this function (comment it out) everyting works
> fine.
> Anyone can confirm this as a bug?
> simple testcase:
> //test.phpms:
> <?php
> $map_path = "/var/mapserver/mapfiles/"; // change to your mappath
> $map_file = "yourmapfile.map"; // change to your testmapfile
> $oMap = ms_newMapObj($map_path.$map_file);
> $oLayer = $oMap->getLayer(0); // first layer must be shape file
> $oLayer->open();
> $oLayer->getShape(-1, 0); // get first feature of shape
> $oLayer->close();
> ?>
> This reproduces the error with me, no matter what mapfile I use.
> Regards,
> --
> ______________________________________
> Vincent Schut (schut at sarvision.com)
> Sarvision B.V.
> Wageningen, The Netherlands
> www.sarvision.com

More information about the mapserver-dev mailing list