[mapserver-users] Problem rendering multiple layers

Mark K. Zanfardino mzanfardino at gmail.com
Fri May 13 14:11:27 EDT 2011


Thomas,

Thank you! I've been struggling with this for several days!  This has 
definitely solved my problem.  I will try to understand what was 
happening and why I was using 'mode=map' in my URL.

Mark Zanfardino

On 05/13/2011 10:22 AM, thomas bonfort wrote:
> mixing the mode=map with a WMS request might be treated differently in
> 5.0 than 5.6. To be on the safe side, either do a mapserver style
> mode=map request without the SERVICE and REQUEST params, or do some
> pure wms requests without the mode=map (the second option seems to be
> what you are trying to achieve)
>
> i.e.: try
> http://10.10.10.105/cgi-bin/mapserv?map=mapdata/ccc.map&LAYERS=county,water&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=-122.41859552788569,37.48140447211431,-121.56140447211433,38.33859552788568&WIDTH=450&HEIGHT=
>
> --
> thomas
>
> On Fri, May 13, 2011 at 19:16, Mark K. Zanfardino<mzanfardino at gmail.com>  wrote:
>> I have created a simple map with two layers with shapefiles as the
>> datasource. I have two servers I am using for testing in order to attempt to
>> identify the source of a problem I am having when I attempt to render the
>> two layers.
>>
>> Server A is running Ubuntu 9.04. It has been patched to the latest releases.
>> I did *not* add the UbuntuGIS repo. I installed the package cgi-mapserver
>> and mapserver-bin (along with the appropriate dependencies). MapServer
>> version 5.0.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG
>> SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
>> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
>> SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS
>> INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>>
>> I then render my map from my browser (Firefox 3.6.17 and Chrome 11.0.696.65)
>> with the following URL:
>>
>> http://10.10.10.86/cgi-bin/mapserv?mode=map&map=mapdata/ccc.map&LAYERS=county,water&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=-122.41859552788569,37.48140447211431,-121.56140447211433,38.33859552788568&WIDTH=450&HEIGHT=450
>> <http://10.10.10.86/cgi-bin/mapserv?mode=map&map=mapdata/ccc.map&LAYERS=county,water&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=-122.41859552788569,37.48140447211431,-121.56140447211433,38.33859552788568&WIDTH=450&HEIGHT=450>
>>
>> The resulting image is rendered at 450x450 and displays both the county and
>> water layers as expected.
>>
>> Server B is running Ubuntu 10.04. It has been patched to the latest
>> releases. I *did* add the UbuntuGIS repo. I installed the same packages.
>> MapServer version 5.6.6 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>> OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
>> SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
>> SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
>> SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS
>> SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL
>> INPUT=SHAPEFILE
>>
>> I then render my map from the browser as before with the following URL:
>>
>> http://10.10.10.105/cgi-bin/mapserv?mode=map&map=mapdata/ccc.map&LAYERS=county,water&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=-122.41859552788569,37.48140447211431,-121.56140447211433,38.33859552788568&WIDTH=450&HEIGHT=450
>> <http://10.10.10.105/cgi-bin/mapserv?mode=map&map=mapdata/ccc.map&LAYERS=county,water&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=-122.41859552788569,37.48140447211431,-121.56140447211433,38.33859552788568&WIDTH=450&HEIGHT=450>
>>
>> The resulting image is rendered at 740x400 and is a single white image (no
>> layers rendered).
>>
>> If I only include one layer at a time the specified layer *does* render
>> (again at 740x400 *not* 450x450 as specified in the URL). If I change the
>> parameters&LAYERS to&LAYER (singular) and use two (one for county and one
>> for water) the two layers render, again at the wrong resolution.
>>
>> I'm completely stumped. I've been using mapserver for a number of years now,
>> but I hadn't upgraded to 5.6.6 as I'd been using it on my ubuntu 9.04
>> server.  I'd love to take advantage of the changes available in 5.6.6 but
>> right now I can't seem to get any of my maps to work. Help!
>>
>> I have enabled debugging for both servers. The output for Server A when
>> requesting to render both county and water is:
>>
>> [Fri May 13 10:13:21 2011].721463 msSearchDiskTree(): Search returned no
>> results. Unable to open spatial index for
>> /usr/lib/cgi-bin/mapdata/./ccc_gis.county.qix. In most cases you can safely
>> ignore this message, otherwise check file names and permissions.
>> [Fri May 13 10:13:21 2011].723899 msDrawMap(): Layer 0 (county), 0.003s
>> [Fri May 13 10:13:21 2011].724028 msSearchDiskTree(): Search returned no
>> results. Unable to open spatial index for
>> /usr/lib/cgi-bin/mapdata/./ccc_gis.water.qix. In most cases you can safely
>> ignore this message, otherwise check file names and permissions.
>> [Fri May 13 10:13:21 2011].726447 msDrawMap(): Layer 1 (water), 0.003s
>>
>> The output for Server B is:
>> [Fri May 13 10:12:23 2011].707688 msSearchDiskTree(): Search returned no
>> results. Unable to open spatial index for
>> /usr/lib/cgi-bin/mapdata/./ccc_gis.county.qix. In most cases you can safely
>> ignore this message, otherwise check file names and permissions.
>> [Fri May 13 10:12:23 2011].710121 msDrawMap(): Layer 0 (county), 0.003s
>> [Fri May 13 10:12:23 2011].710285 msSearchDiskTree(): Search returned no
>> results. Unable to open spatial index for
>> /usr/lib/cgi-bin/mapdata/./ccc_gis.water.qix. In most cases you can safely
>> ignore this message, otherwise check file names and permissions.
>> [Fri May 13 10:12:23 2011].712486 msDrawMap(): Layer 1 (water), 0.002s
>>
>>
>> My map file is as follows:
>> #
>> # Start of map file
>> #
>> MAP
>>   NAME ccc
>>   STATUS on
>>   EXTENT -122.40 37.70 -121.50 38.05
>>   SIZE 740 400
>>   UNITS dd
>>   SHAPEPATH "."
>>   IMAGECOLOR 255 255 255
>>   FONTSET "./fonts.list"
>>   TEMPLATEPATTERN "example"
>>   CONFIG "MS_ERRORFILE" "/var/log/mapserver.log"
>>
>>   OUTPUTFORMAT
>>     NAME png
>>     DRIVER "GD/PNG"
>>     MIMETYPE "image/png"
>>     IMAGEMODE PC256
>>     EXTENSION "png"
>>   END
>>   OUTPUTFORMAT
>>     NAME png24
>>     DRIVER "GD/PNG"
>>     MIMETYPE "image/png"
>>     IMAGEMODE RGB
>>     EXTENSION "png"
>>   END
>>   OUTPUTFORMAT
>>     NAME jpeg
>>     DRIVER "GD/JPEG"
>>     MIMETYPE "image/jpeg"
>>     FORMATOPTION "QUALITY=75"
>>     IMAGEMODE RGB
>>     EXTENSION "jpg"
>>   END
>>
>>   #
>>   # Projection definition, consult the PROJ.4 documentation for parameter
>> discussion
>>   #
>>   PROJECTION
>>      "init=epsg:4326"
>>   END
>>
>>   #
>>   # Start of web interface definition (including WMS enabling metadata)
>>   #
>>   WEB
>>     IMAGEPATH '/data/tmp/'
>>     IMAGEURL '/tmp/'
>>     METADATA
>>       WMS_TITLE "Contra Costa County Mapserver"
>>       WMS_ABSTRACT "This is a UMN MapServer application for Contra Costa
>> County."
>>       # change this value to match your setup
>>       WMS_ONLINERESOURCE "http://localhost/cgi-bin/mapserv?"
>>       WMS_SRS "EPSG:4326"
>>     END
>>   END
>>
>>   #
>>   # Start of LAYER DEFINITIONS ---------------------------------------------
>>   #
>>   LAYER
>>     NAME             county
>>     DEBUG        3
>>     DATA        ccc_gis.county.shp
>>     STATUS          OFF
>>     TYPE             POLYGON
>>
>>     METADATA
>>       WMS_TITLE "Contra Costa County"
>>       WMS_ABSTRACT "County polygon for Contra Costa County."
>>       WMS_SRS "EPSG:4326"
>>     END
>>
>>     CLASS
>>       STYLE
>>         OUTLINECOLOR     0 0 0
>>         COLOR         242 239 233
>>       END
>>     END
>>   END # County polygon layer ends here
>>
>>   #
>>   # Start of LAYER DEFINITIONS ---------------------------------------------
>>   #
>>   LAYER
>>     NAME                water
>>     DEBUG        3
>>     DATA        ccc_gis.water.shp
>>     STATUS              OFF
>>     TYPE                POLYGON
>>
>>     METADATA
>>       WMS_TITLE "Contra Costa County"
>>       WMS_ABSTRACT "County polygon for Contra Costa County."
>>       WMS_SRS "EPSG:4326"
>>     END
>>
>>     CLASS
>>       STYLE
>>         COLOR             155 177 205
>>       END
>>     END
>>   END # Water polygon layer ends here
>>
>> END
>>
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>


More information about the mapserver-users mailing list