VS: [mapserver-users] [UMN_MAPSERVER-USERS] can i pass variables toshp2img?

Stephen Woodbridge woodbri at swoodbridge.com
Tue Mar 18 15:51:31 EDT 2008


Frank Warmerdam wrote:
> John Smith wrote:
>> frank,
>> ok so it's easier to get to the image using shp2img.exe since
>> mapserv.exe dumps the image in /temp/ under a random name.
>>
>> but how'd i get the image name just using mapserv.exe from commandline?
> 
> John,
> 
> If you are running mapserv in WMS mode, the image is written to
> stdout, and can be redirected to any file.

you can also do this with mode=map as a parameter in the QUERY_STRING, 
but this has a problem in that the mime type headers are emitted before 
the image also to stdout and this will cause the redirected image to be 
broken as an image.

That said, it would also be pretty trivial to write a perl script to 
strip off the HTTP header lines. THis should assume that there are other 
lines also like cookies cache control headers, etc.

-Steve W

> If traditional mode, the filename base is created with msTmpFile()
> which normally uses the time and processed id as part of the filename.
> But you can use the undocumented -tmpbase switch to mapserv at the
> commandline to force a new value for this base to give predictable
> temp file names.
> 
> eg.
> 
> mapserv -tmpbase test QUERY_STRING='...'
> 
> I implemented this for testing scripts but in the end didn't need
> it so it is possible that it is somewhat broken.
> 
> Best regards,



More information about the mapserver-users mailing list