Two quastions about WMS and .map file

Apr 17, 2008 at 10:33 AM
Hi
I have two questions that i can't find on sharpmaps's homepage and google.
1. what woes sharpmap.layers.wmsLayer() return ? is it an image or is it all layers that the server contains or a XML file or what? (Try to configure my mapserver to work with shrpmap but with no success)
2. if i have a library with *.shp filens and s *.map file to them can i easy import the .map file and get the whole picture or do i have to import all layers, layer by layer ?

Im using sharpmap v0.9
/Adam
Developer
Apr 17, 2008 at 12:30 PM
1) on each GetMap request the sharpmap.layers.wmsLayer will do a request to the WMS and will get an image in return. It will then render this image to the canvas. The sharpmap.layers.wmsLayer request can consist of multiple WMS layers . You have to specify which WMS layers you want to request from the WMS. Note, the concept of layer is confusing here because there are sharpmap layers and wms layers.

In this sample
http://www.codeplex.com/SharpMap/SourceControl/FileView.aspx?itemId=428730&changeSetId=32815
the WMS layers are added like this:
layWms.AddLayer("Bathymetry");
layWms.AddLayer("Ocean features");

2) No there is no easy way to import it from the .map file. You have to specify it in code.
Apr 17, 2008 at 2:03 PM
Ok thnx now i understand a bit more.
but i sitll have one problem that i cant solve,

When i add this adress:
(http://www2.demis.nl/wms/wms.asp?Service=WMS&WMS=BlueMarble&Version=1.1.0&Request=GetMap&BBox=-20,-40,60,40&SRS=EPSG:4326&Width=400&Height=400&Layers=Earth%20Image,Borders,Coastlines&Format=image/gif)
in my webbrowser it show me a picture without any promlems.
but when i take the same url an put it in wmslayer("test", url); i get an error "could not download capabilities"
I dont understand isn't a diffrent query i need to use or am i misunderstanding wms totaly?
/Adam
Developer
Apr 17, 2008 at 4:29 PM
Edited Apr 17, 2008 at 4:51 PM

You have to provide the base url, not the complete request url:
http://www2.demis.nl/wms/wms.asp?Service=WMS&WMS=BlueMarble
The capabilities are then returned ok.

But i did some tests and there is another issue. There turns out to be a little flaw in the demis server configuration. In the capabilities there is this line:
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://www2.demis.nl/wms/wms.asp?wms=Blue Marble&"/>
The OnlineResource in the capabilties is used for any further wms requests (as it should) but as you can see, 'wms=Blue Marble' has a space in it, which seems to be incorrect. If I manually remove the space from the request it works okay.

We have to mail demis to fix it I guess.
Developer
Apr 18, 2008 at 1:14 PM
They fixed it:
http://support.demis.nl/forums/1937/ShowThread.aspx#1937