<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Beautiful, yes. After a bit of fudging and adjusting (because I don't actually have access to the actual server I'm really trying to use), I managed to get it "not" working on my localhost as it was "not" working on that server. On localhost I was able to put the DEBUG in the map file and see the results. It told me that it couldn't resolve the host (Host not found). <br><br>There is an extra '/' in the path being put in the WMC. Instead of http://&lt;domain&gt;/... in the OnlineResource, it is getting http:///&lt;domain&gt;/... during the process. Now I just have to figure out why that's happening but I'm sure it won't be difficult.<br><br>Thank you for reminding me of the DEBUG.<br><br>Cheers,<br>jtm<br><br>&gt; From: jean-francois@gigand.fr<br>&gt; Date: Tue, 8 Feb 2011 22:32:59 +0100<br>&gt; Subject: Re: [mapserver-users] Dynamic WMS Service - Projections problem?<br>&gt; To: joanne.mcgraw@sympatico.ca<br>&gt; CC: mapserver-users@lists.osgeo.org<br>&gt; <br>&gt; Hi,<br>&gt; <br>&gt; Have you checked the MapServer logs?<br>&gt; <br>&gt; To enable it, set the env variable MS_ERRORFILE to the log file path<br>&gt; and MS_DEBUGLEVEL to "5".<br>&gt; It will detail interesting details about how your layers are built.<br>&gt; <br>&gt; Jeff<br>&gt; <br>&gt; <br>&gt; 2011/2/8 myOpenLayersUName &lt;joanne.mcgraw@sympatico.ca&gt;:<br>&gt; &gt;<br>&gt; &gt; First, the background...<br>&gt; &gt;<br>&gt; &gt; I have a WMS Service that has an "empty" point layer in it. I use it to<br>&gt; &gt; display labels at dynamically generated coordinates by passing x,y within<br>&gt; &gt; the request. For example:<br>&gt; &gt;<br>&gt; &gt; http://&lt;domain&gt;/ogc/mapserv?map=/path/fenceLabelWms_en.map&amp;map.layer[fencelabel]=FEATURE<br>&gt; &gt; POINTS -105.5620661354989 51.14394472618872 END TEXT "Fence 1"<br>&gt; &gt; END&amp;map.layer[fencelabel].class[0]=COLOR 255 0 0<br>&gt; &gt; END&amp;map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR<br>&gt; &gt; END&amp;LAYERS=fencelabel&amp;mode=map<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; The entire map file is as follows:<br>&gt; &gt;<br>&gt; &gt; MAP<br>&gt; &gt; &nbsp;NAME "fenceLabelWms_en"<br>&gt; &gt; &nbsp;FONTSET "../../../mapserv/etc/fonts.txt"<br>&gt; &gt; &nbsp;SYMBOLSET "../../../mapserv/etc/symbols.sym"<br>&gt; &gt; &nbsp;SIZE 400 300<br>&gt; &gt; &nbsp;IMAGETYPE PNG<br>&gt; &gt; &nbsp;IMAGECOLOR 255 255 255<br>&gt; &gt; &nbsp;RESOLUTION 96<br>&gt; &gt; &nbsp;EXTENT -141.5 41.5 -51.5 83.5 # all of Canada<br>&gt; &gt; &nbsp;UNITS METERS<br>&gt; &gt; &nbsp;PROJECTION<br>&gt; &gt; &nbsp; &nbsp;"init=epsg:4269" # lat/long<br>&gt; &gt; &nbsp;END<br>&gt; &gt; &nbsp;WEB<br>&gt; &gt; &nbsp; &nbsp;METADATA<br>&gt; &gt; &nbsp; &nbsp; &nbsp;"wms_srs" "EPSG:42304"<br>&gt; &gt; &nbsp; &nbsp;END<br>&gt; &gt; &nbsp;END<br>&gt; &gt;<br>&gt; &gt; &nbsp;OUTPUTFORMAT<br>&gt; &gt; &nbsp; &nbsp;NAME png<br>&gt; &gt; &nbsp; &nbsp;DRIVER 'GD/PNG'<br>&gt; &gt; &nbsp; &nbsp;MIMETYPE 'image/png'<br>&gt; &gt; &nbsp; &nbsp;IMAGEMODE PC256 #RGB<br>&gt; &gt; &nbsp; &nbsp;FORMATOPTION "INTERLACE=OFF"<br>&gt; &gt; &nbsp; &nbsp;EXTENSION 'png'<br>&gt; &gt; &nbsp; &nbsp;TRANSPARENT ON<br>&gt; &gt; &nbsp;END<br>&gt; &gt;<br>&gt; &gt; &nbsp;LAYER<br>&gt; &gt; &nbsp; &nbsp;NAME "fencelabel"<br>&gt; &gt; &nbsp; &nbsp;STATUS ON<br>&gt; &gt; &nbsp; &nbsp;TYPE point<br>&gt; &gt; &nbsp; &nbsp;CLASS<br>&gt; &gt; &nbsp; &nbsp; &nbsp;SIZE 0<br>&gt; &gt; &nbsp; &nbsp; &nbsp;COLOR 0 0 0<br>&gt; &gt; &nbsp; &nbsp; &nbsp;LABEL<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;TYPE truetype<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;FONT verdana<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;ANTIALIAS false<br>&gt; &gt; &nbsp; &nbsp; &nbsp;END<br>&gt; &gt; &nbsp; &nbsp;END<br>&gt; &gt; &nbsp;END<br>&gt; &gt; END<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; A number of &nbsp;applications use this WMS and each has its own projection but,<br>&gt; &gt; as in the request above, all pass the x,y as lat/long (EPSG:4269). The MAP<br>&gt; &gt; METADATA's "wms_srs" lists the supported projections (for the purposes of<br>&gt; &gt; this example, I'm simplifying by only including EPSG:42304).<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; So, this allows me to provide the point coordinates in lat/long, but display<br>&gt; &gt; them using the projection from the application itself. For example:<br>&gt; &gt;<br>&gt; &gt; http://&lt;domain&gt;/ogc/mapserv?map=/path/fenceLabelWms_en.map&amp;map.layer[fencelabel]=FEATURE<br>&gt; &gt; POINTS -105.5620661354989 51.14394472618872 END TEXT 'Fence 1'<br>&gt; &gt; END&amp;map.layer[fencelabel].class[0]=COLOR 255 0 0<br>&gt; &gt; END&amp;map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR<br>&gt; &gt; END&amp;LAYERS=fencelabel&amp;FORMAT=image/png&amp;SRS=EPSG:42304&amp;TRANSPARENT=true&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;EXCEPTIONS=application/vnd.ogc.se_inimage&amp;BBOX=-2903297.000,-789911.0000,3431059.000,3959683.000&amp;WIDTH=1219&amp;HEIGHT=601<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Knowing this, I can define this "dynamic" layer within a WMC &lt;Layer&gt; tag and<br>&gt; &gt; load it into an OpenLayers Map (whose projection is set to EPSG:42304 and<br>&gt; &gt; extents encompass all of Canada). The WMC definition for the above layer is<br>&gt; &gt; as follows (we use a batch script to set the path to the MapServer<br>&gt; &gt; executable and MAP file, "fenceLabelWms_en"):<br>&gt; &gt;<br>&gt; &gt; &lt;Layer queryable="0" hidden="0"&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;Server service="OGC:WMS" version="1.1.1"&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;OnlineResource xlink:type="simple"<br>&gt; &gt; xlink:href="http://&lt;domain&gt;/ogc/fenceLabelWms_en?map.layer[fencelabel]=FEATURE%20POINTS%20-105.5620661354989%2051.14394472618872%20END%20TEXT%20'Fence%201'%20END&amp;amp;map.layer[fencelabel].class[0]=COLOR%20255%20105%200%20END&amp;amp;map.layer[fencelabel].class[0]=LABEL%20COLOR%20255%20105%200%20SIZE%2010%20POSITION%20LR%20END"/&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;/Server&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;Name&gt;fencelabel&lt;/Name&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;Title&gt;Fence 1&lt;/Title&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;SRS&gt;EPSG:42304&lt;/SRS&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;FormatList&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Format current="1"&gt;image/png&lt;/Format&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;/FormatList&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;Extension&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ol:maxExtent minx="-2903297.000" miny="-789911.0000"<br>&gt; &gt; maxx="3431059.000" maxy="3959683.000"/&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ol:transparent&gt;true&lt;/ol:transparent&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ol:numZoomLevels&gt;5&lt;/ol:numZoomLevels&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ol:units&gt;m&lt;/ol:units&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ol:isBaseLayer&gt;false&lt;/ol:isBaseLayer&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ol:displayInLayerSwitcher&gt;false&lt;/ol:displayInLayerSwitcher&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ol:singleTile&gt;true&lt;/ol:singleTile&gt;<br>&gt; &gt; &nbsp; &nbsp;&lt;/Extension&gt;<br>&gt; &gt; &lt;/Layer&gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Okay, everything works fine up to this point. The fence label WMS is<br>&gt; &gt; displayed in the OpenLayers Map correctly in relation to the other layers it<br>&gt; &gt; contains, all of which have projections of EPSG:42304.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Now, the problem ...<br>&gt; &gt;<br>&gt; &gt; I’d like to print the image displayed to the user. To do this, I have<br>&gt; &gt; another "empty" MAP file that I use to print the WMC; the same WMC I loaded<br>&gt; &gt; into OpenLayers. The entire contents of this MAP file are:<br>&gt; &gt;<br>&gt; &gt; MAP<br>&gt; &gt; &nbsp;NAME "wmsContextServer"<br>&gt; &gt; &nbsp;FONTSET "../../../mapserv/etc/fonts.txt"<br>&gt; &gt; &nbsp;SYMBOLSET "../../../mapserv/etc/symbols.sym"<br>&gt; &gt; &nbsp;SIZE 400 300<br>&gt; &gt; &nbsp;STATUS ON<br>&gt; &gt; &nbsp;IMAGETYPE PNG<br>&gt; &gt; &nbsp;IMAGECOLOR 255 255 255<br>&gt; &gt; &nbsp;EXTENT -2338951 -800000 3008692 3900000<br>&gt; &gt; &nbsp;UNITS METERS<br>&gt; &gt; &nbsp;CONFIG "CGI_CONTEXT_URL" "1"<br>&gt; &gt; &nbsp;PROJECTION<br>&gt; &gt; &nbsp; &nbsp;"init=epsg:42304"<br>&gt; &gt; &nbsp;END<br>&gt; &gt;<br>&gt; &gt; &nbsp;RESOLUTION 96<br>&gt; &gt;<br>&gt; &gt; &nbsp;REFERENCE<br>&gt; &gt; &nbsp; &nbsp;# Parameter settings NOT to change<br>&gt; &gt; &nbsp; &nbsp;STATUS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ON<br>&gt; &gt; &nbsp; &nbsp;COLOR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -1 -1 -1<br>&gt; &gt; &nbsp; &nbsp;OUTLINECOLOR &nbsp; &nbsp;255 0 0<br>&gt; &gt; &nbsp; &nbsp;# Parameter settings that will change if you replace the default<br>&gt; &gt; 'refmap.png'<br>&gt; &gt; &nbsp; &nbsp;IMAGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "../htdocs/images/refmap.png"<br>&gt; &gt; &nbsp; &nbsp;SIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;100 74<br>&gt; &gt; &nbsp; &nbsp;EXTENT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-2.2e+006 -712631 3.0728e+006 3.84e+006<br>&gt; &gt; &nbsp;END # REFERENCE<br>&gt; &gt;<br>&gt; &gt; &nbsp;SCALEBAR<br>&gt; &gt; &nbsp; &nbsp;STATUS EMBED<br>&gt; &gt; &nbsp; &nbsp;INTERVALS 1<br>&gt; &gt; &nbsp; &nbsp;POSITION LL<br>&gt; &gt; &nbsp; &nbsp;TRANSPARENT true<br>&gt; &gt; &nbsp; &nbsp;UNITS kilometers<br>&gt; &gt; &nbsp; &nbsp;STYLE 1<br>&gt; &gt; &nbsp; &nbsp;SIZE 100 7<br>&gt; &gt; &nbsp; &nbsp;LABEL<br>&gt; &gt; &nbsp; &nbsp; &nbsp;SIZE small<br>&gt; &gt; &nbsp; &nbsp;END<br>&gt; &gt; &nbsp;END<br>&gt; &gt;<br>&gt; &gt; &nbsp;WEB<br>&gt; &gt; &nbsp; &nbsp;INCLUDE "../../../mapserv/conf/imagepath.inc.map"<br>&gt; &gt; &nbsp; &nbsp;METADATA<br>&gt; &gt; &nbsp; &nbsp; &nbsp;# Used for App Page Title<br>&gt; &gt; &nbsp; &nbsp; &nbsp;"wms_title" "WMC Context Client"<br>&gt; &gt; &nbsp; &nbsp; &nbsp;"wms_connectiontimeout" "60"<br>&gt; &gt; &nbsp; &nbsp;END<br>&gt; &gt; &nbsp;END<br>&gt; &gt; &nbsp;OUTPUTFORMAT<br>&gt; &gt; &nbsp; &nbsp;NAME png<br>&gt; &gt; &nbsp; &nbsp;DRIVER 'GD/PNG'<br>&gt; &gt; &nbsp; &nbsp;MIMETYPE 'image/png'<br>&gt; &gt; &nbsp; &nbsp;IMAGEMODE RGB<br>&gt; &gt; &nbsp; &nbsp;FORMATOPTION "INTERLACE=OFF"<br>&gt; &gt; &nbsp; &nbsp;EXTENSION 'png'<br>&gt; &gt; &nbsp; &nbsp;#TRANSPARENT ON<br>&gt; &gt; &nbsp;END<br>&gt; &gt;<br>&gt; &gt; &nbsp;OUTPUTFORMAT<br>&gt; &gt; &nbsp; &nbsp;NAME gif<br>&gt; &gt; &nbsp; &nbsp;DRIVER 'GD/GIF'<br>&gt; &gt; &nbsp; &nbsp;MIMETYPE 'image/gif'<br>&gt; &gt; &nbsp; &nbsp;IMAGEMODE RGB<br>&gt; &gt; &nbsp; &nbsp;FORMATOPTION "INTERLACE=OFF"<br>&gt; &gt; &nbsp; &nbsp;EXTENSION 'gif'<br>&gt; &gt; &nbsp;END<br>&gt; &gt;<br>&gt; &gt; END<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Unfortunately, the "dynamic" WMS layer doesn't appear in the output image. I<br>&gt; &gt; can use the following URL to get an image of all the other layers in the WMC<br>&gt; &gt; successfully, but the fence label is not shown and there is no error<br>&gt; &gt; message:<br>&gt; &gt;<br>&gt; &gt; http://&lt;domain&gt;/ogc/mapserv?map=/path/wmsContextServer.map&amp;mode=map&amp;context=http://&lt;domain&gt;/contexts/WMCwFenceLabels.xml&amp;layers=all<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; I'm guessing MapServer is getting a blank image when it's assembling the<br>&gt; &gt; layers for the output image and I'm further guessing that this is the result<br>&gt; &gt; of the projections somehow getting out of whack somewhere along the line.<br>&gt; &gt; I'm thinking that the point is being evaluated as not actually existing<br>&gt; &gt; within the extents of the output image being generated, perhaps? But, I<br>&gt; &gt; can't guess why this would be the case. There is no question that it does<br>&gt; &gt; fall within the extents (as witnessed by loading the same WMC in<br>&gt; &gt; OpenLayers).<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; As it is now, I am completely stuck as to what the problem might be. Can<br>&gt; &gt; anyone suggest anything that might help me narrow down exactly what the<br>&gt; &gt; problem is or a direction I can investigate further?<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; View this message in context: http://osgeo-org.1803224.n2.nabble.com/Dynamic-WMS-Service-Projections-problem-tp6004893p6004893.html<br>&gt; &gt; Sent from the Mapserver - User mailing list archive at Nabble.com.<br>&gt; &gt; _______________________________________________<br>&gt; &gt; mapserver-users mailing list<br>&gt; &gt; mapserver-users@lists.osgeo.org<br>&gt; &gt; http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>&gt; &gt;<br>                                               </body>
</html>