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