[mapserver-users] WMS and map script

Kralidis,Tom [Ontario] Tom.Kralidis at ec.gc.ca
Wed Mar 4 14:01:32 EST 2009


> 
> I am getting junk extent values after calling 
> layerObj.getExtent() on a WMS layer.
> 
>  
> 
> This is the WMS server url
> 
> http://www2.demis.nl/wms/wms.asp
> 
>  
> 
> I have used a layer called Countries from that server and 
> this is the capability xml for that layer
> 
>                                                 <Layer 
> queryable="1" opaque="0">
> 
>                                                               
>   <Name>Countries</Name>
> 
>                                                               
>   <Title>Countries</Title>
> 
>                                                               
>   <BoundingBox SRS="EPSG:4326" minx="-180" miny="-90" 
> maxx="180" maxy="83.6333923339844"/>
> 
>                                                 </Layer>
> 
>  
> 
> This is the entry in map file
> 
>   LAYER
> 
>     CONNECTION "http://www2.demis.nl/wms/wms.asp?wms=SAMPLE&"
> 
>     CONNECTIONTYPE WMS
> 
>     METADATA
> 
>       "wms_srs"    "EPSG:4326"
> 
>       "wms_name"              "Countries"
> 
>       "wms_format"            "image/png"
> 
>       "wms_server_version"           "1.1.0"
> 
>     END
> 
>     NAME "Countries"
> 
>     PROJECTION
> 
>       "init=epsg:4326"
> 
>     END
> 
>     STATUS ON
> 
>     TYPE RASTER
> 
>     UNITS DD
> 
>   END
> 
>  
> 
> I get extents values (minx, miny, maxx and maxy) as 
> -4.8366978272229995E-26 (which is not same as above in the 
> capabilities xml)
> 
>  
> 
> Appreciate any help.
> 

MapServer won't do a GetCapabiilties to get the extent for remote WMS
layers.  If you set LAYER.EXTENT accordingly, layer.getExtent() will
work accordingly.

..Tom


More information about the mapserver-users mailing list