Raster layer (file)

View inMAUIUWPWPFWinUIView on GitHub

Create and use a raster layer made from a local raster file.

Image of raster layer 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

  1. Create a Raster from a raster file.
  2. Create a RasterLayer from the raster.
  3. 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:

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

RasterLayerFile.xamlRasterLayerFile.xamlRasterLayerFile.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
<UserControl x:Class="ArcGIS.UWP.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>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.