php-mapscript: abnormal death
Bart van den Eijnden
bartvde at XS4ALL.NL
Thu Mar 3 12:36:45 PST 2005
Hi Mark,
Have you defined an outputformat in your MAP file (or dynamically in php)?
http://mapserver.gis.umn.edu/doc44/mapfile-reference.html#outputformat
eg for png 8 bits:
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END
Maybe you even need to set it (I don't know if this is necessary if there
is only 1 output format though ...):
$map->selectOutputFormat('png');
Hope this helps.
Best regards,
Bart
On Thu, 3 Mar 2005 12:33:54 -0800, Mark Leslie <mark at REFRACTIONS.NET>
wrote:
> The majority of the script is switches just turning on the requested
> layers and defining postgis data lines. The
> interesting (and faulty) part is the end, and is attached below. There
> isn't much exciting happening there. It
> was originally built for mapscript 3.6.5, I believe.
>
> $quantiles = explode( '|', $quantiles );
> foreach( $quantiles as $q ) {
> $class = ms_newClassObj( $lha_layer );
> $info = explode( ',', $q );
> $expr = "([$column] >= " . $info[0] . " AND [$column] <= " .
> $info[1] . ")";
> $class->setExpression( $expr );
> $color = explode( '.', $info[2] );
> $style = ms_newStyleObj($class);
> $style->color->setRGB($color[0], $color[1], $color[2] );
> $style->outlinecolor->setRGB( 180, 180, 180 );
> $class->set( 'status', MS_ON );
> }
>
> //draw and return the map
>
> $image = $map->draw();
>
> header( "Content-Type: image/png" );
> #$image->saveImage( '', MS_PNG, 0, 0, 0 );
>
> $image->saveImage('');
>
> $err = ms_GetErrorObj();
>
> while($error && $error->code != MS_NOERR) {
> printf("Error in %s: %s<br />\n", $error->routine, $error->message);
> $error = $error->next();
> }
> #echo $err[0] . "<--";
>
> ?>
>
>>
>> Mark,
>>
>> Can you send along a code snippet so we can see the syntax?
>>
>> Are you working with an application that was designed around a much
>> older version of MapServer (say, 3.6.x)? If so, take a look at the
>> "saveImage() and saveWebImage()" section at
>> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MigrationGuide
>>
>> You could also configure MapServer with --enable-debug to trap some more
>> information.
>>
>> --Dylan
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
More information about the MapServer-users
mailing list