Create and use a raster layer made from a local raster file.
Use case
Rasters can be digital aerial photographs, imagery from satellites, digital pictures, or even scanned maps. An end-user will frequently need to import raster files acquired through various data-collection methods into their map to view and analyze the data.
How to use the sample
When the sample starts, a raster will be loaded from a file and displayed in the map view.
How it works
- Create a
Raster
from a raster file. - Create a
RasterLayer
from the raster. - Add it as an operational layer with
Map.OperationalLayers.Add(layer)
.
Relevant API
- Raster
- RasterLayer
Offline data
This sample downloads the following items from ArcGIS Online automatically:
- raster-file.zip - Tif raster file
Additional information
See the topic What is raster data? in the ArcMap documentation for more information about raster images.
Tags
data, image, import, layer, raster, visualization
Sample Code
<UserControl x:Class="ArcGISRuntime.WinUI.Samples.RasterLayerFile.RasterLayerFile"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
<Grid>
<esriUI:MapView x:Name="MyMapView" />
</Grid>
</UserControl>