Re: [mapserver-users] Dynamic WMS Service - Projections problem?
Great! Good luck for your issue, and to get it working again on your server! Jeff 2011/2/8 : > 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). > > There is an extra '/' in the path being put in the WMC. Instead of > http:///... in the OnlineResource, it is getting > http:... during the process. Now I just have to figure out why > that's happening but I'm sure it won't be difficult. > > Thank you for reminding me of the DEBUG. > > Cheers, > jtm > >> From: jean-franc...@gigand.fr >> Date: Tue, 8 Feb 2011 22:32:59 +0100 >> Subject: Re: [mapserver-users] Dynamic WMS Service - Projections problem? >> To: joanne.mcg...@sympatico.ca >> CC: mapserver-users@lists.osgeo.org >> >> Hi, >> >> Have you checked the MapServer logs? >> >> To enable it, set the env variable MS_ERRORFILE to the log file path >> and MS_DEBUGLEVEL to "5". >> It will detail interesting details about how your layers are built. >> >> Jeff >> >> >> 2011/2/8 myOpenLayersUName : >> > >> > First, the background... >> > >> > I have a WMS Service that has an "empty" point layer in it. I use it to >> > display labels at dynamically generated coordinates by passing x,y >> > within >> > the request. For example: >> > >> > >> > http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE >> > POINTS -105.5620661354989 51.14394472618872 END TEXT "Fence 1" >> > END&map.layer[fencelabel].class[0]=COLOR 255 0 0 >> > END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION >> > UR >> > END&LAYERS=fencelabel&mode=map >> > >> > >> > The entire map file is as follows: >> > >> > MAP >> > NAME "fenceLabelWms_en" >> > FONTSET "../../../mapserv/etc/fonts.txt" >> > SYMBOLSET "../../../mapserv/etc/symbols.sym" >> > SIZE 400 300 >> > IMAGETYPE PNG >> > IMAGECOLOR 255 255 255 >> > RESOLUTION 96 >> > EXTENT -141.5 41.5 -51.5 83.5 # all of Canada >> > UNITS METERS >> > PROJECTION >> > "init=epsg:4269" # lat/long >> > END >> > WEB >> > METADATA >> > "wms_srs" "EPSG:42304" >> > END >> > END >> > >> > OUTPUTFORMAT >> > NAME png >> > DRIVER 'GD/PNG' >> > MIMETYPE 'image/png' >> > IMAGEMODE PC256 #RGB >> > FORMATOPTION "INTERLACE=OFF" >> > EXTENSION 'png' >> > TRANSPARENT ON >> > END >> > >> > LAYER >> > NAME "fencelabel" >> > STATUS ON >> > TYPE point >> > CLASS >> > SIZE 0 >> > COLOR 0 0 0 >> > LABEL >> > TYPE truetype >> > FONT verdana >> > ANTIALIAS false >> > END >> > END >> > END >> > END >> > >> > >> > A number of applications use this WMS and each has its own projection >> > but, >> > as in the request above, all pass the x,y as lat/long (EPSG:4269). The >> > MAP >> > METADATA's "wms_srs" lists the supported projections (for the purposes >> > of >> > this example, I'm simplifying by only including EPSG:42304). >> > >> > >> > So, this allows me to provide the point coordinates in lat/long, but >> > display >> > them using the projection from the application itself. For example: >> > >> > >> > http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE >> > POINTS -105.5620661354989 51.14394472618872 END TEXT 'Fence 1' >> > END&map.layer[fencelabel].class[0]=COLOR 255 0 0 >> > END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION >> > UR >> > >> > END&LAYERS=fencelabel&FORMAT=image/png&SRS=EPSG:42304&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&
RE: [mapserver-users] Dynamic WMS Service - Projections problem?
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). There is an extra '/' in the path being put in the WMC. Instead of http:///... in the OnlineResource, it is getting http:... during the process. Now I just have to figure out why that's happening but I'm sure it won't be difficult. Thank you for reminding me of the DEBUG. Cheers, jtm > From: jean-franc...@gigand.fr > Date: Tue, 8 Feb 2011 22:32:59 +0100 > Subject: Re: [mapserver-users] Dynamic WMS Service - Projections problem? > To: joanne.mcg...@sympatico.ca > CC: mapserver-users@lists.osgeo.org > > Hi, > > Have you checked the MapServer logs? > > To enable it, set the env variable MS_ERRORFILE to the log file path > and MS_DEBUGLEVEL to "5". > It will detail interesting details about how your layers are built. > > Jeff > > > 2011/2/8 myOpenLayersUName : > > > > First, the background... > > > > I have a WMS Service that has an "empty" point layer in it. I use it to > > display labels at dynamically generated coordinates by passing x,y within > > the request. For example: > > > > http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE > > POINTS -105.5620661354989 51.14394472618872 END TEXT "Fence 1" > > END&map.layer[fencelabel].class[0]=COLOR 255 0 0 > > END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR > > END&LAYERS=fencelabel&mode=map > > > > > > The entire map file is as follows: > > > > MAP > > NAME "fenceLabelWms_en" > > FONTSET "../../../mapserv/etc/fonts.txt" > > SYMBOLSET "../../../mapserv/etc/symbols.sym" > > SIZE 400 300 > > IMAGETYPE PNG > > IMAGECOLOR 255 255 255 > > RESOLUTION 96 > > EXTENT -141.5 41.5 -51.5 83.5 # all of Canada > > UNITS METERS > > PROJECTION > >"init=epsg:4269" # lat/long > > END > > WEB > >METADATA > > "wms_srs" "EPSG:42304" > >END > > END > > > > OUTPUTFORMAT > >NAME png > >DRIVER 'GD/PNG' > >MIMETYPE 'image/png' > >IMAGEMODE PC256 #RGB > >FORMATOPTION "INTERLACE=OFF" > >EXTENSION 'png' > >TRANSPARENT ON > > END > > > > LAYER > >NAME "fencelabel" > >STATUS ON > >TYPE point > >CLASS > > SIZE 0 > > COLOR 0 0 0 > > LABEL > >TYPE truetype > >FONT verdana > >ANTIALIAS false > > END > >END > > END > > END > > > > > > A number of applications use this WMS and each has its own projection but, > > as in the request above, all pass the x,y as lat/long (EPSG:4269). The MAP > > METADATA's "wms_srs" lists the supported projections (for the purposes of > > this example, I'm simplifying by only including EPSG:42304). > > > > > > So, this allows me to provide the point coordinates in lat/long, but display > > them using the projection from the application itself. For example: > > > > http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE > > POINTS -105.5620661354989 51.14394472618872 END TEXT 'Fence 1' > > END&map.layer[fencelabel].class[0]=COLOR 255 0 0 > > END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR > > 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.,3431059.000,3959683.000&WIDTH=1219&HEIGHT=601 > > > > > > Knowing this, I can define this "dynamic" layer within a WMC tag and > > load it into an OpenLayers Map (whose projection is set to EPSG:42304 and > > extents encompass all of Canada). The WMC definition for the above layer is > > as follows (we use a batch script to set the path to the MapServer > > executable and MAP file, "fenceLabelWms_en"): > > > > > > > > > xlink:href="http:///ogc/fenceLabelWms_en?map.lay
Re: [mapserver-users] Dynamic WMS Service - Projections problem?
Hi, Have you checked the MapServer logs? To enable it, set the env variable MS_ERRORFILE to the log file path and MS_DEBUGLEVEL to "5". It will detail interesting details about how your layers are built. Jeff 2011/2/8 myOpenLayersUName : > > First, the background... > > I have a WMS Service that has an "empty" point layer in it. I use it to > display labels at dynamically generated coordinates by passing x,y within > the request. For example: > > http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE > POINTS -105.5620661354989 51.14394472618872 END TEXT "Fence 1" > END&map.layer[fencelabel].class[0]=COLOR 255 0 0 > END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR > END&LAYERS=fencelabel&mode=map > > > The entire map file is as follows: > > MAP > NAME "fenceLabelWms_en" > FONTSET "../../../mapserv/etc/fonts.txt" > SYMBOLSET "../../../mapserv/etc/symbols.sym" > SIZE 400 300 > IMAGETYPE PNG > IMAGECOLOR 255 255 255 > RESOLUTION 96 > EXTENT -141.5 41.5 -51.5 83.5 # all of Canada > UNITS METERS > PROJECTION > "init=epsg:4269" # lat/long > END > WEB > METADATA > "wms_srs" "EPSG:42304" > END > END > > OUTPUTFORMAT > NAME png > DRIVER 'GD/PNG' > MIMETYPE 'image/png' > IMAGEMODE PC256 #RGB > FORMATOPTION "INTERLACE=OFF" > EXTENSION 'png' > TRANSPARENT ON > END > > LAYER > NAME "fencelabel" > STATUS ON > TYPE point > CLASS > SIZE 0 > COLOR 0 0 0 > LABEL > TYPE truetype > FONT verdana > ANTIALIAS false > END > END > END > END > > > A number of applications use this WMS and each has its own projection but, > as in the request above, all pass the x,y as lat/long (EPSG:4269). The MAP > METADATA's "wms_srs" lists the supported projections (for the purposes of > this example, I'm simplifying by only including EPSG:42304). > > > So, this allows me to provide the point coordinates in lat/long, but display > them using the projection from the application itself. For example: > > http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE > POINTS -105.5620661354989 51.14394472618872 END TEXT 'Fence 1' > END&map.layer[fencelabel].class[0]=COLOR 255 0 0 > END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR > 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.,3431059.000,3959683.000&WIDTH=1219&HEIGHT=601 > > > Knowing this, I can define this "dynamic" layer within a WMC tag and > load it into an OpenLayers Map (whose projection is set to EPSG:42304 and > extents encompass all of Canada). The WMC definition for the above layer is > as follows (we use a batch script to set the path to the MapServer > executable and MAP file, "fenceLabelWms_en"): > > > > xlink:href="http:///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"/> > > fencelabel > Fence 1 > EPSG:42304 > > image/png > > > maxx="3431059.000" maxy="3959683.000"/> > true > 5 > m > false > false > true > > > > > Okay, everything works fine up to this point. The fence label WMS is > displayed in the OpenLayers Map correctly in relation to the other layers it > contains, all of which have projections of EPSG:42304. > > > Now, the problem ... > > I’d like to print the image displayed to the user. To do this, I have > another "empty" MAP file that I use to print the WMC; the same WMC I loaded > into OpenLayers. The entire contents of this MAP file are: > > MAP > NAME "wmsContextServer" > FONTSET "../../../mapserv/etc/fonts.txt" > SYMBOLSET "../../../mapserv/etc/symbols.sym" > SIZE 400 300 > STATUS ON > IMAGETYPE PNG > IMAGECOLOR 255 255 255 > EXTENT -2338951 -80 3008692 390 > UNITS METERS > CONFIG "CGI_CONTEXT_URL" "1" > PROJECTION > "init=epsg:42304" > END > > RESOLUTION 96 > > REFERENCE > # Parameter settings NOT to change > STATUS ON > COLOR -1 -1 -1 > OUTLINECOLOR 255 0 0 > # Parameter settings that will change if you replace the default > 'refmap.png' > IMAGE "../htdocs/images/refmap.png" > SIZE 100 74 > EXTENT -2.2e+006 -712631 3.0728e+006 3.84e+006 > END # REFERENCE > > SCALEBAR > STATUS EMBED > INTERVALS 1 > POSITION LL > TRANSPARENT true > UNITS kilometers > STYLE 1 > SIZE 100 7 > LABEL > SIZE small > END > END > > WEB > INCLUDE "../../../mapserv/conf/imagepath.inc.map" > METADATA > # Used for App Page Title > "wms_title" "WMC Context Clien
[mapserver-users] Dynamic WMS Service - Projections problem?
First, the background... I have a WMS Service that has an "empty" point layer in it. I use it to display labels at dynamically generated coordinates by passing x,y within the request. For example: http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE POINTS -105.5620661354989 51.14394472618872 END TEXT "Fence 1" END&map.layer[fencelabel].class[0]=COLOR 255 0 0 END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR END&LAYERS=fencelabel&mode=map The entire map file is as follows: MAP NAME "fenceLabelWms_en" FONTSET "../../../mapserv/etc/fonts.txt" SYMBOLSET "../../../mapserv/etc/symbols.sym" SIZE 400 300 IMAGETYPE PNG IMAGECOLOR 255 255 255 RESOLUTION 96 EXTENT -141.5 41.5 -51.5 83.5 # all of Canada UNITS METERS PROJECTION "init=epsg:4269" # lat/long END WEB METADATA "wms_srs" "EPSG:42304" END END OUTPUTFORMAT NAME png DRIVER 'GD/PNG' MIMETYPE 'image/png' IMAGEMODE PC256 #RGB FORMATOPTION "INTERLACE=OFF" EXTENSION 'png' TRANSPARENT ON END LAYER NAME "fencelabel" STATUS ON TYPE point CLASS SIZE 0 COLOR 0 0 0 LABEL TYPE truetype FONT verdana ANTIALIAS false END END END END A number of applications use this WMS and each has its own projection but, as in the request above, all pass the x,y as lat/long (EPSG:4269). The MAP METADATA's "wms_srs" lists the supported projections (for the purposes of this example, I'm simplifying by only including EPSG:42304). So, this allows me to provide the point coordinates in lat/long, but display them using the projection from the application itself. For example: http:///ogc/mapserv?map=/path/fenceLabelWms_en.map&map.layer[fencelabel]=FEATURE POINTS -105.5620661354989 51.14394472618872 END TEXT 'Fence 1' END&map.layer[fencelabel].class[0]=COLOR 255 0 0 END&map.layer[fencelabel].class[0]=LABEL COLOR 255 0 0 SIZE 10 POSITION UR 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.,3431059.000,3959683.000&WIDTH=1219&HEIGHT=601 Knowing this, I can define this "dynamic" layer within a WMC tag and load it into an OpenLayers Map (whose projection is set to EPSG:42304 and extents encompass all of Canada). The WMC definition for the above layer is as follows (we use a batch script to set the path to the MapServer executable and MAP file, "fenceLabelWms_en"): fencelabel Fence 1 EPSG:42304 image/png true 5 m false false true Okay, everything works fine up to this point. The fence label WMS is displayed in the OpenLayers Map correctly in relation to the other layers it contains, all of which have projections of EPSG:42304. Now, the problem ... I’d like to print the image displayed to the user. To do this, I have another "empty" MAP file that I use to print the WMC; the same WMC I loaded into OpenLayers. The entire contents of this MAP file are: MAP NAME "wmsContextServer" FONTSET "../../../mapserv/etc/fonts.txt" SYMBOLSET "../../../mapserv/etc/symbols.sym" SIZE 400 300 STATUS ON IMAGETYPE PNG IMAGECOLOR 255 255 255 EXTENT -2338951 -80 3008692 390 UNITS METERS CONFIG "CGI_CONTEXT_URL" "1" PROJECTION "init=epsg:42304" END RESOLUTION 96 REFERENCE # Parameter settings NOT to change STATUS ON COLOR -1 -1 -1 OUTLINECOLOR255 0 0 # Parameter settings that will change if you replace the default 'refmap.png' IMAGE "../htdocs/images/refmap.png" SIZE100 74 EXTENT -2.2e+006 -712631 3.0728e+006 3.84e+006 END # REFERENCE SCALEBAR STATUS EMBED INTERVALS 1 POSITION LL TRANSPARENT true UNITS kilometers STYLE 1 SIZE 100 7 LABEL SIZE small END END WEB INCLUDE "../../../mapserv/conf/imagepath.inc.map" METADATA # Used for App Page Title "wms_title" "WMC Context Client" "wms_connectiontimeout" "60" END END OUTPUTFORMAT NAME png DRIVER 'GD/PNG' MIMETYPE 'image/png' IMAGEMODE RGB FORMATOPTION "INTERLACE=OFF" EXTENSION 'png' #TRANSPARENT ON END OUTPUTFORMAT NAME gif DRIVER 'GD/GIF' MIMETYPE 'image/gif' IMAGEMODE RGB FORMATOPTION "INTERLACE=OFF" EXTENSION 'gif' END END Unfortunately, the "dynamic" WMS layer doesn't appear in the output image. I can use the following URL to get an image of all the other layers in the WMC successfully, but the fence label is not shown and there is no error message: http:///ogc/mapserv?map=/path/wmsContextServer.map&mode=map&context=http:///contexts/WMCwFenceLabels.xml&layers=all I'm guessing MapServer is getting a blank image when it's assemb