AW: [mapserver-users] map file paths
Waberzeck, Thomas
Thomas.Waberzeck at liag-hannover.de
Thu Nov 4 08:46:51 PDT 2010
Ok, but as I wrote - we use a php wrapper to hide our mapfiles. The main code is just as follows:
<?php
$request = ms_newowsrequestobj();
$request->loadparams();
ms_ioinstallstdouttobuffer();
$oMap = ms_newMapobj("path/to/my.map");
$oMap->owsdispatch($request);
$contenttype = ms_iostripstdoutbuffercontenttype();
if ($contenttype == 'image/png')
header('Content-type: image/png');
ms_iogetStdoutBufferBytes();
ms_ioresethandlers();
?>
Using this file works at least in QuantumGIS and should do so in others.
Thomas
Von: John Callahan [mailto:john.callahan at udel.edu]
Gesendet: Donnerstag, 4. November 2010 15:18
An: Waberzeck, Thomas
Cc: Rahkonen Jukka; mapserver-users at lists.osgeo.org
Betreff: Re: [mapserver-users] map file paths
The PHP mapscript wrapper looks promising. Thanks. The examples would need to be combined into one php file to handle both GetMap and GetCapabilities requests. Seems doable. I'm not a programmer and didn't want to get into mapscript, however, modifying this script template doesn't seem too difficult (if you already have PHP, which my server does.)
I'm not a big fan of copying and renaming the mapserv.exe file but it does work well. We only publish a handful of services and do not expect to significantly increase in the future. If we do, scripting a batch file would work just as well. This is relatively easy and without the need to install (re: maintenance, security) or learn additional programming languages.
For me, it's also important to have short, easily readable URLs to send out to people that use our WMS services. I do not want the extra "?map=mymap" parameters at the end of the URLs. For one reason or another, things always get screwed up when people start pasting these URLs into their desktop GIS or other apps. Simpler the better, even if it's not elegant or involves slightly more work on my part.
- John
**************************************************
John Callahan, Research Scientist
Delaware Geological Survey, University of Delaware
URL: http://www.dgs.udel.edu
**************************************************
On Thu, Nov 4, 2010 at 2:53 AM, Waberzeck, Thomas <Thomas.Waberzeck at liag-hannover.de<mailto:Thomas.Waberzeck at liag-hannover.de>> wrote:
Jukka Rahkonen wrote:
> P Kishor wrote:
>
> > So you have 15 copies of the binary floating around on your computer.
> > What a nightmare. If you upgrade, you have to make 15 copies of the
> > new version and replace the old version.
>
> > What would happen when you publish the 150th geologic map?
>
> > Use a single binary, and use a wrapper (or the env variable) to get
> > the right query.
>
> I do not believe there are handy wrappers for Windows and the only way
> I have been able to get SetEnvIf to work is to make copies of
> mapserv.exe with different names. I maintain a batch file about our
> services with lines like "COPY mapserv.exe WMS_service1" etc. and then
> I only need to run the batch after update and publishing the 150th
> service does not change anything.
If you have php it's quite easy to write a small wrapper for it. See http://www.mapserver.org/ogc/mapscript.html#php-example so the only thing to do is to write the wrappers once and you have a single setup of Mapserver.
Thomas
BTW: The Example should be updated - I think php_mapscript_4.10.0.dll is out of date. The name of the .dll is just php_mapscript.dll.
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20101104/1b04965b/attachment.htm>
More information about the MapServer-users
mailing list