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

3623
11
08-28-2017 06:31 PM
Parh_JinChia
New Contributor

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

and RasterLayerRasterFunction

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

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

Tags (1)
0 Kudos
11 Replies
Parh_JinChia
New Contributor

you're right! I didn't know there is a difference in allowed functionality

between the different license types... this seems like such a basic

functionality.

thanks for the help!

0 Kudos
VeronicaValenzuela
New Contributor

Is there an updated version of this? I could not get this one to work for me. I copied the code exactly.

0 Kudos