wms childlayer

Topics: Algorithms, SharpMap v0.9 / v1.x, WinForms Controls
Jun 10, 2010 at 10:45 PM

there is some limitation in sharmap v 0.9 about chilayer of wms ?

i try to use some and when i add a childlayer  my map transform in a empty image.

tks

Coordinator
Jun 13, 2010 at 10:03 AM

Hi longuard, it sounds like you are adding data from different spatial reference systems without applying the correct transforms, or you have the styles/ themes incorrectly set. hth jd

Jun 14, 2010 at 12:50 PM
Edited Jun 14, 2010 at 12:58 PM

hi may be your right, i use Gaia 3 to test the url and the childlayer, and this is the query text in gaia http://SERVERURL?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=LAYERNAME&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&CRS=EPSG:4326&BBOX=42.8632,-90.2178,64.2855,-46.7822&WIDTH=602&HEIGHT=429

and this is the code i use :

 wmsLayer = new SharpMap.Layers.WmsLayer("CARTENAME", wmsServerURL);

wmsLayer.AddLayer(layerNameToAdd);

wmsLayer.SRID = 4326; // also make try with900913EPSG:32198

wmsLayer.SetImageFormat(wmsLayer.OutputFormats[0]);

wmsLayer.SpatialReferenceSystem = "EPSG:32198";

myMap.Layers.Add(wmsLayer);

SharpMap.Geometries.Point lowerLeft = new SharpMap.Geometries.Point(-90.2178,42.8632 );

SharpMap.Geometries.Point upperRight = new SharpMap.Geometries.Point(-46.7822 ,64.2855 );

SharpMap.Geometries.BoundingBox dBox = new SharpMap.Geometries.BoundingBox(lowerLeft, upperRight);

 myMap.ZoomToBox(dBox);

Do you think i need somethings else

thanks

Developer
Jun 22, 2010 at 10:22 AM

Do you use the latest source code for your project?

Major improvements have been made in Change Set 66042, e.g. transparancy and bgcolor have been added to the client, the SpatialReferenceSystem has been merged with the SRID and there is better support for WMS-servers with projected maps.I suggest you should use the source code from  change set 66042 onwards to make use of this functionality.

And mayby you should check the bbox from your WMS request with the dBox you create later on. Your bbox  = BBOX=42.8632,-90.2178,64.2855,-46.7822
which is minx(42.86) miny(-90.21) maxx(64.28) maxy(-46.78). See WMS 1.1.1 and 1.3.0 OGC specs for more detail on this.
The dBox you create however has a lowerleftpoint with x(-90.21) and y(42.86) and you should probably swap them (and also your upperright) to get the right images.

Hope this helps you

Jun 22, 2010 at 4:23 PM

Thanks for your reply,

the upgrade solve some trouble but now when i change te coordinnate  for this 

SharpMap.Geometries.Point lowerLeft = new SharpMap.Geometries.Point(-90.2178,42.8632 );

SharpMap.Geometries.Point upperRight = new SharpMap.Geometries.Point(-46.7822 ,64.2855 );

and with the old coordinnate i see nothing

 

i see city in affrica and i suppose to view quebec city. and if i zoom in or out the map i lose all image also when i move the map

Pier 

 

 

Jun 22, 2010 at 10:20 PM

i have found my data after putting a 60 000 timeout .....