Raster layer (file)

View inAndroidFormsUWPWPFWinUIiOSView 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
9
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.RasterLayerFile.RasterLayerFile"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms">
    <Grid>
        <esriUI:MapView x:Name="MyMapView" />
    </Grid>
</ContentPage>

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