Is there a straight forward way to call a WMS service that gives a satelite image as a base, cache it or save it, and then have it on its own raster layer instead of calling the WMS service again? I want to find a way to call the service once, get the image, and then run in a disconnected enviornment like a laptop where the WMS service isn't available.
WMS image service and local raster layer
Peter,
Thanks for your post.
I think you could try setting a TileCache system which probably need to be a FileBitmapTileCache for your overlay which contains the target WmsRasterLayer. Following is the code snippet for it.
WmsRasterLayer wmsImageLayer = new WmsRasterLayer(new Uri("wmssamples.thinkgeo.com/WmsServer.aspx"));
wmsImageLayer.UpperThreshold = double.MaxValue;
wmsImageLayer.LowerThreshold = 0;
wmsImageLayer.Open();
foreach (string layerName in wmsImageLayer.GetServerLayerNames())
{
wmsImageLayer.ActiveLayerNames.Add(layerName);
}
// this parameter is just optional.
wmsImageLayer.Exceptions = "application/vnd.ogc.se_xml";
LayerOverlay imageOverlay = new LayerOverlay();
imageOverlay.Layers.Add("wmsImageLayer", wmsImageLayer);
imageOverlay.TileCache = new FileBitmapTileCache(@"C:\temp");
Any more questions just feel free to let me know.
Thanks.
Yale