[Mapserver-users] Mapfile, setting Mapfile Header Attributes OTF w/ PHP MapScript...

Daniel Morissette morissette at dmsolutions.ca
Mon Sep 22 16:35:19 EDT 2003


Can't you use relative paths in your mapfile?  If the relative path from 
your mapfile directory to the symbols directory then you won't have any 
problem.

e.g. Assuming the mapfile is in the directory that is the parent of the 
MSym directory

  G:\Inetpub\wwwroot\rmtweb\yourmap.map on the INTERNET box, and
  G:\Inetpub\wwwroot\yourmap.map on the INTRANET box.

then you could have

   SYMBOLSET "MSym\symbol.sym"

in the mapfile and that would work on both at least for the SYMBOLSET, 
FONTSET and SHAPEPATH.  The IMAGEPATH may be a little more tricky I'm 
not sure.

Of course the simplest is to mirror exactly the same directory structure 
on both boxes.

Daniel


Chip Hankley wrote:
> NOTE:
> 
> I'm still working in 3.6...
> 
> We have an application that runs both internally and externally. The
> app is identical in every way EXCEPT in it's location on the server
> (i.e. internal runs on our Intranet box, external on our Internet box).
> 
> On the external box, the path to my application is slightly different:
> 
> For instance:
> 
> SYMBOLSET "G:\Inetpub\wwwroot\rmtweb\MSym\symbol.sym" on the INTERNET
> box, and
> SYMBOLSET "G:\Inetpub\wwwroot\MSym\symbol.sym" on the INTRANET box.
> 
> What I was trying to set up was a function that would allow me to use
> exactly the same mapfiles on both boxes by dynamically changing the
> header information on the fly... something like this:
> 
> $map = ms_newMapObj("test.map");
> setup_mapfile($map);
> 
> function setup_mapfile($map) {
>   if ($_SERVER["COMPUTERNAME"] == "RMTWEB") { //The external box
>     $FONTSET =
> "G:\\Inetpub\\wwwroot\\rmtweb\\MSym\\fonts\\fonts.list";
>     $SYMBOLSET = "G:\\Inetpub\\wwwroot\\rmtweb\\MSym\\symbol.sym";
>     $SHAPEPATH = "G:\\Inetpub\\wwwroot\\rmtweb\\g35688\\GIS\\data\\";
>     $IMAGEPATH = "G:\\Inetpub\\wwwroot\\rmtweb\\tmp\\";
>   }
>   elseif ($_SERVER["COMPUTERNAME"] == "RMTINT") {//The internal box
>     $FONTSET = "G:\\Inetpub\\wwwroot\\MSym\\fonts\\fonts.list";
>     $SYMBOLSET = "G:\\Inetpub\\wwwroot\\MSym\\symbol.sym";
>     $SHAPEPATH = "G:\\Inetpub\\wwwroot\\g35688\\GIS\\data\\";
>     $IMAGEPATH = "G:\\Inetpub\\wwwroot\\tmp\\";
>   }
>   $map->setFontSet($FONTSET);
>   $map->setSymbolSet($SYMBOLSET);
>   $map->set("shapepath",$SHAPEPATH);
>   $map->web->set("imagepath", $IMAGEPATH);
> }
> 
> This, however, doesn't work, b/c as soon as the mapfile declaration
> looks at the mapfile, it runs across symbol definitions that it can't
> find a definition for... i.e. MapServer is checking the mapfile before I
> can fix the problems with the "setup_mapfile" function. I tried putting
> an "@" in front of the mapfile declaration, but this doesn't help b/c
> the error is fatal (so I never get to the function).
> 
> Anyone know of a way around this?
> 
> TIA!
> 
> Chip Hankley
> 
> 
> 
> Outgoing messages, along with any attachments, are scanned for viruses at RMT prior to sending.
> ------------------------------------------------------------------------------
> NOTICE--This email may contain confidential and privileged information 
> for the sole use of the intended recipient.  Any review or distribution
> by others is strictly prohibited.  If you are not the intended recipient,
> please contact the sender immediately and delete all copies.





More information about the mapserver-users mailing list