[mapserver-users] WMS Client does not recognize "wms_extent"

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Apr 14 09:36:22 EDT 2010


Hi,

I am not sure about what is going wrong but I do not really believe that changing from a local image to remote WMS service is quite as straight forward as you seem to suppose. 

When you use a local image you are creating the original WMS layer yourself.  The METADATA section is describing your service.  In case of cascading WMS the METADATA section has (mostly) different meaning: it is telling the instructions for your Mapserver about how to make a connection with the remote server.  Therefore some of your METADATA lines do not make sense with a remote WMS.  I suppose "wms_extent" is one of those.  You cannot set the extents of the remote WMS layer, they are set by the remote server which in this case is http://mailserv2/cgi-bin/grid_test.pl?

Perhaps it is a bit misleading that METADATA section has a rather different function in these two use cases. Maybe something like CONNECTION_METADATA would describe better the cascading WMS case.

Read again the document http://mapserver.org/ogc/wms_client.html and have a try by making a cascading WMS layer as described there and pasted below:

LAYER
  NAME "prov_bound"
  TYPE RASTER
  STATUS ON
  CONNECTION "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?"
  CONNECTIONTYPE WMS
  METADATA
    "wms_srs"             "EPSG:42304"
    "wms_name"            "prov_bound"
    "wms_server_version"  "1.1.1"
    "wms_format"          "image/gif"
  END
END


I suppose that you will loose most of the metadata sent by the remote server because Mapserver concentrates in capturing images and processing them further. This is taken from the same WMS client document:

"MapServer does not attempt to fetch the layer's capabilities. Doing so at every map draw would be extremely inefficient. And caching that information does not belong in the core of MapServer. This is better done at the application level, in a script, and only the necessary information is passed to the MapServer core via the CONNECTION string and metadata."

-Jukka Rahkonen-


Heiko Schröter wrote:

> Hello,
> 
> mapserver seems not to take "wms_extent" into account when 
> receiving raster images via WMS.
> According to the docs this tag should take precedence over all others.
> 
> Case 1, SRC Projection = DST Projection :
> a) Images are displayed correctly when read via DATA 
> statement. msResampleGDALToMap() called.
> b) Images are displayed incorrectly when read via WMS. 
> wld_file does not matter. msDrawRasterLayerGDAL() called. 
> Calling msResampleGDALToMap() instead fixes this.
> 
> Case 2, SRC Projection != DST Projection
> a) Images are displayed correctly when read via DATA 
> statement. msResampleGDALToMap() called.
> b) Images are displayed incorrectly when read via WMS. 
> wld_file does matter. msResampleGDALToMap() called. 
> "wms_extent" not recognized and does not take precedence. 
> Bug(?) in msGetGDALGeoTransform().
> Force Removing the wld_file in mapwmslayer.c in function 
> msDrawWMSLayerLow() before msDrawLayer() is called, forces 
> same proceeding as with images read via DATA statement and fixes it.
> 
> 
> Else something is broken in the processing logic of the WMS 
> (client) handling or i'am doing something completely wrong 
> (and stupid).
> 
> Thanks and Regards
> Heiko
> 
> 
> /var/www/localhost/mapserver/mapserv -v
> MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG 
> OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG 
> SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER 
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER 
> INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
> 
> 
> The image recieved via WMS is the same as the in the DATA statment.
> 	LAYER
> 		EXTENT -180 -90 180 90
> 		NAME "GRID_TEST"
> 		OPACITY 60
> 		STATUS ON
> 		DEBUG ON
> 		METADATA
> 			"wms_timeextent" "1970-01-01/2030-12-31"
> 			"wms_timeitem" "datum" #column in 
> postgis table of type timestamp
> 			"wms_timedefault" "2007-12-10/2007-12-11"
> 			"wms_title" "grid_test"
> 			"wms_name" "grid_test"
> 			"wms_format" "image/png"
> 			"wms_server_version" "1.1.1"
> 			"wms_srs" "EPSG:4326"
> 			"wms_extent" "-180 -90 180 90"
> 		END
> 		PROJECTION
> 			"init=epsg:4326"
> 		END
> 		CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"
> 		CONNECTIONTYPE WMS
> #		DATA 
> "/var/www/localhost/htdocs/grafik/wackelkontakt.png"
> 		TYPE RASTER
> 	END # Layer
> 
> 
> 
> 	LAYER
> 		EXTENT -180 -90 180 90
> 		NAME "GRID_TEST1"
> 		OPACITY 60
> 		STATUS ON
> 		DEBUG ON
> 		METADATA
> 			"wms_timeextent" "1970-01-01/2030-12-31"
> 			"wms_timeitem" "datum" #column in 
> postgis table of type timestamp
> 			"wms_timedefault" "2007-12-10/2007-12-11"
> 			"wms_title" "grid_test1"
> 			"wms_name" "grid_test1"
> 			"wms_format" "image/png"
> 			"wms_server_version" "1.1.1"
> 			"wms_srs" "EPSG:4326"
> 			"wms_extent" "-180 -90 180 90"
> 		END
> 		PROJECTION
> 			"init=epsg:4326"
> 		END
> #		CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"
> #		CONNECTIONTYPE WMS
> 		DATA 
> "/var/www/localhost/htdocs/grafik/wackelkontakt.png"
> 		TYPE RASTER
> 	END # Layer
> _______________________________________________
> 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