Read GeoPackage

View inMAUIUWPWPFWinUIView on GitHub

Add rasters and feature tables from a GeoPackage to a map.

Image of read GeoPackage

Use case

The OGC GeoPackage specification defines an open standard for sharing raster and vector data. You may want to use GeoPackage files to support file-based sharing of geographic data.

How to use the sample

When the sample loads, the feature tables and rasters from the GeoPackage will be shown on the map.

How it works

  1. Open the GeoPackage using GeoPackage.OpenAsync(path).
  2. Iterate through available rasters exposed by geopackage.GeoPackageRasters.
    • For each raster, create a raster layer using new Rasterlayer(geopackageRaster), then add it to the map.
  3. Iterate through available feature tables, exposed by geopackage.GeoPackageFeatureTables.
    • For each feature table, create a feature layer using new FeatureLayer(geopackageFeatureTable), then add it to the map.

Relevant API

  • GeoPackage
  • GeoPackage.GeoPackageFeatureTables
  • GeoPackage.GeoPackageRasters
  • GeoPackageFeatureTable
  • GeoPackageRaster

Offline data

The Aurora Colorado GeoPackage holds datasets that cover Aurora, Colorado.

About the data

This sample features a GeoPackage with datasets that cover Aurora, Colorado: Public art (points), Bike trails (lines), Subdivisions (polygons), Airport noise (raster), and liquour license density (raster).

Additional information

GeoPackage uses a single SQLite file (.gpkg) that conforms to the OGC GeoPackage Standard. You can create a GeoPackage file (.gpkg) from your own data using the create a SQLite Database tool in ArcGIS Pro.

Tags

container, GeoPackage, layer, map, OGC, package, raster, table

Sample Code

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