[mapserver-users] WMS and map script

Murty Maganti MMaganti at oriongis.com
Wed Mar 4 11:13:04 PST 2009


That won't help me. 
I add the wms layer dynamically to map using C# mapscript (and then save
the map object to map file).

I can get the extents from capabilities but layer.extent is readonly and
can't be set.

Thanks
Murty


-----Original Message-----
From: Kralidis,Tom [Ontario] [mailto:Tom.Kralidis at ec.gc.ca] 
Sent: Wednesday, March 04, 2009 2:02 PM
To: Murty Maganti; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] WMS and map script

> 
> 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