Raster layer (GeoPackage)
Display a raster contained in a GeoPackage.
GeoPackages are designed to simplify file management and transfer. They can store raster files (as well as other types of data). An end-user wishing to transfer rasters from ArcGIS Pro or between runtime apps, might need to import raster files from GeoPackages into their map to view and analyze the data.
When the sample starts, a raster will be loaded from a GeoPackage and displayed in the map view.
- Create and load a
GeoPackage, specifying the path to the local .gpkg file.
- When it is done loading, get the
GeoPackageRasters from the geopackage.
- Construct a
RasterLayerwith the geopackage raster you want to use.
- Add the raster layer to the map.
This sample downloads the following items from ArcGIS Online automatically:
The Aurora Colorado GeoPackage holds datasets that cover Aurora, Colorado. The raster that is opened and displayed shows airport noise levels.
container, data, image, import, layer, OGC, package, raster, visualization
<?xml version="1.0" encoding="utf-8" ?> <ContentPage 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" xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime" x:Class="ArcGISRuntime.Samples.RasterLayerGeoPackage.RasterLayerGeoPackage"> <esriUI:MapView x:Name="MyMapView"/> </ContentPage>