[Chameleon] Map display problem

McGraw, Joanne mcgrawj at AGR.GC.CA
Thu Mar 10 11:45:03 EST 2005


Paul,

I've had a chance to look into this problem further and have found that
the problem is related to the shapefile itself. More specifically, to
the column I am trying to use as the CLASSITEM. MapServer does not have
a problem displaying this shapefile in 6 classes. Unfortunately, the
Chameleon Map widgets (MapDHTMLWidget and MapImageStatic) do.

I have created a test package and explain below how to recreate the
problem with the test data. The zip file, however, is about 75
megabytes, so I'm not sure what the best approach is to get it to you.
Is there an FTP site I can use?

Test Procedure
--------------
1. Unzip the contents of the zip into a single directory.

2. Through your browser, load the classTest.phtml and, in another
browser, LoadMap.php. 

Given the current settings in the map file it will work and you'll see
what you are supposed to see. The LoadMap.php will display a single map
that is only using MapServer functionality to perform the display.
Through the classTest.phtml, you will see two maps; the top using the
MapDHTMLWidget object and the bottom, the MapImageStatic object.

3. Now, in classTest.map, go to the classTest layer definition and
comment out the current data value Export_Output and uncomment the other
data value, Original.

4. Repeat step 2...reload classTest.phtml and LoadMap.php

The classTest.phtml page will not display the maps. The php process
trying to display the MapImageStatic will run for about 4 minutes before
it fails with the "Premature end of script headers" error in Apache's
error.log. The process for the MapDHTMLWidget will run for about 5
minutes before it too fails with the same message. The LoadMap page,
however, will work.

I have done nothing to the Export_Output version of this data besides
export the Original shapefile. I should note, also, that at one point I
added a new column to the Original shapefile and Calc'ed all the values
from the TOTL_N_C_C column into it. I changed the map file to use that
new column instead of the TOTL_N_C_C one and all worked fine. 

There is obviously some kind of difference in the TOTL_N_C_C column
definition or the data it contains because the size of the DBFs are
different. The Export_Output version is bigger... which is very odd; I
expected the opposite. 

At issue, is the fact that MapServer seems able to overcome the
difference whereas Chameleon widgets seem to be struggling with it. 

I am using the "ms4w_1.0.3.zip" and "chameleon_ms4w-2.0.zip" found on
your MS4W downloads page. My operating system is Windows XP Pro 2002
with Service Pack 1. My system has a Pentium 4, 3 GHz processor and 1 Gb
of RAM.

Assuming you want it, let me know how you'd like me to deliver the zip
to you.

Cheers,
jtm

-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca] 
Sent: Saturday, March 05, 2005 9:34 AM
To: McGraw, Joanne
Cc: chameleon at lists.maptools.org
Subject: Re: [Chameleon] Map display problem

Joanne,
in this kind of case, it is most likely a problem with php_mapscript or 
your map file.  You can normally test this using a simple test script 
outside of Chameleon.

<?php
dl('php_mapscript.so'); //or whatever your module is
$oMap=ms_newMapObj('<path-to-mapfile>');
$oImg=$oMap->draw();
$szURL=$oImg->saveWebImage();
echo "<img src='$szURL'>";
?>

if that works, then it could be a problem with Chameleon.  If it doesn't

work, then you may get better error messages ... or at least something 
to take to the mapserver mailing list.

Cheers
Paul

McGraw, Joanne wrote:
> Has anyone ever heard of problems displaying maps that result in the 
> error message:
> 
> Premature end of script headers: php.exe, referer: 
> http://localhost/mapdata/indicators2005/index.phtml
> 
> being added to Apache's error.log? I've searched the archives and
people 
> have noted it, but no one has suggested a solution. My particular 
> problem strikes me as some kind of memory overrun somewhere...possibly
in 
> MapServer itself, but I really don't know.
> 
> I have a shapefile with 12,353 features. For a particular layer, I am 
> using a CLASSITEM that points to a double data type field with values 
> ranging from 0.0 to 496.95. To display it, I would like to set 6
classes 
> that use logical expressions to define what class they should be 
> displayed as. However, when I use 6 classes, php.exe chugs away for a 
> while and then coughs with the error noted above. The map display
fails.
> 
> If, on the other hand, I use only 5 of the classes to display, it 
> works!! It does not matter which 5 of the classes I include or, 
> conversely, which 1 of the 6 classes I leave out. Any combination is 
> fine...as long as it's only a combination of 5 classes. Adding a sixth

> makes the display break again.
> 
> Does this sound like anything anyone has come across? Or, has anyone 
> come across the "Premature end of script headers..." error before and 
> found a different solution to fixing it?
> 
> Cheers,
> Jtm
> 
> 
>
------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+



More information about the Chameleon mailing list