Using different OUTPUTFORMAT?
John Fletcher
jfletcher at LATITUDEGEO.COM
Fri Nov 23 16:32:15 PST 2007
Whether your final image is jpeg or png depends on the format included
in the request, rather than what's included in the OUTPUTFORMAT block.
I don't even normally put an OUTPUTFORMAT block in my mapfile -
mapserver will accept requests for any image formats that it's been
programmed to use by default (which includes jpeg and png for you
already, very likely).
That said, you can put multiple OUTPUTFORMAT blocks in your mapfile.
They are actually children of the MAP block rather than the LAYER block
- you can't declare that a particular layer in a mapfile is only to be
rendered in a particular output format. See the OUTPUTFORMAT section in
the mapfile reference for more details.
To get a jpeg for layer1 and a png for layer2, you'll need two separate
requests, like:
http://server/mapserv?request=GetMap&...&format=image/jpeg&layers=layer1
&...
http://server/mapserv?request=GetMap&...&format=image/png&layers=layer2&
...
This is for CGI - if you're using mapscript someone else'll have to let
you know how to generate the separate images.
John Fletcher
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Sacha Black
Sent: Friday, November 23, 2007 2:13 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Using different OUTPUTFORMAT?
i'm looking in the mapfile reference docs, and i can't figure out if it
is possible to use more than one OUTPUTFORMAT in a single mapfile.
for example I want to use JPEG for a photo layer and PNG for a different
layer.
is it possible? if so, how to specify in the layer definitions in the
map file?
sacha
More information about the MapServer-users
mailing list