parhjin

How to use a Raster image as a basemap or layer?

Discussion created by parhjin on Aug 28, 2017
Latest reply on Sep 5, 2017 by parhjin

Hi, I have discovered there is a Raster type and RasterLayer in Esri ArcGIS

Runtime for .Net.

However I could not get it to work.

In the github samples, I could only find RasterLayerImageServiceRaster

<https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/master/src/WPF/ArcGISRuntime.WPF.Samples/Samples/Layers/RasterLayerImageServiceRaster>

and RasterLayerRasterFunction

<https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/master/src/WPF/ArcGISRuntime.WPF.Samples/Samples/Layers/RasterLayerRasterFunction>

 

I just want to create a Raster Layer from a GeoTIFF file stored on local

disk and then display it. Nothing too fancy.

 

My code at the moment looks something like:

 

Raster myRaster = new Raster(@"C:\tiffmap.tif");

RasterLater newRasterLayer = new RasterLayer(myRaster);

 

Basemap myBasemap = _map.Basemap;

LayerCollection myLayerCollection = myBasemap.BaseLayers;

myLayerCollection.Add(newRasterLayer);

 

but the map is not showing. I get a blank map. I have tried using WMTSLayer and it works, so I am not too far off.

What should I be doing? The documentation and examples are sparse....

 

rgds

PJ

Outcomes