[ka-Map-users] Problems with KaMap tile.php, with MapServer 5.6

Jeff Dege jeff.dege at korterra.com
Wed Jun 9 15:21:13 EST 2010


We've been running a few map servers on Windows, using KaMap to deliver tiles, for a couple of years.  I'm trying to move one of them onto a new Ubuntu box, and I'm having problems.

My problem is when I try to access a tile from a browser, passing args directly to tile.php in the URL:

    http://10.0.0.59/testmap/tile.php?map=testmap&g=all&i=gif&t=-11200&l--29000&s-1000000

The browser is finding tile.php without problems, but Apache is returning "HTTP 500 Internal Server Error".

Looking in the apache logs, I see:

[Wed Jun 09 14:02:42 2010] [error] [client 127.0.0.1]
PHP Notice:  Undefined offset: 6 in /var/www/testmap/htdocs/tile.php on line 229

[Wed Jun 09 14:02:42 2010] [error] [client 127.0.0.1]
PHP Warning:  Division by zero in /var/www/ testmap /htdocs/tile.php on line 229

So I look at my tile.php.   Lines 228 and 229 are:

        $inchesPerUnit = array(1, 12, 63360.0, 39.3701, 39370.1, 4374754);
        $geoWidth = $scale/($oMap->resolution*$inchesPerUnit[$oMap->units]);

It looks like "$oMap->units" has the value "6", which is not a valid index into $inchesPerUnit, so we get the errors, above.

The mapfile contains "UNITS DD"

My first thought was that since I'd installed a more recent version of mapserver on the unix box than had been running on the windows box, maybe php_mapscript.so's ms_newMapObj() function is returning a different set of values in units.  But I downloaded the most recent version of tile.php, and in it the $inchesPerUnit array has the same values.

OTOH, a glance at the mapserver 5.6.3 source reveals:

   enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_NAUTICALMILES,
      MS_DD, MS_PIXELS, MS_PERCENTAGES};

Which gives MS_DD the value of 6.

So, am I correct in my understanding that the version of tile.php I am using will not work with mapserver 5.6 without modifications?

I downloaded kamap from http://ka-map.maptools.org/index.phtml?page=downloads.html.  The tile.php in it is v 1.41.  (The one I was using on the Windows box was v 1.1).

Is there a more recent version of KaMap, than the one I downloaded from maptools.org?

Is there any version of KaMap that has kept up-to-date with current developments in mapserv?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20100609/c0f55c6b/attachment.htm 


More information about the ka-Map-users mailing list