Data files

You can build applications that display maps and scenes, edit features, and analyze data using data files stored locally on your device.

Data files

What is a data file?

A data file is a local file stored on a device that contains data that can be displayed by a layer in a map or scene. Some data files also support editing, querying, and analyzing data.

You use data files to build offline applications that:

  • Display maps or scenes without a network connection.
  • Can access, display, and analyze data sideloaded onto a device.
  • Include data with an application install.
  • Collect data on devices that never have access to a network connection.
  • Share datasets between applications using peer-to-peer technology.

Data files can be created using a number of tools or scripts, or downloaded from the internet.

How a data file works

To use a data file, you sideload or download it onto a device. You can then access the data file directly from local storage. You typically reference it with a layer and add the layer to a map or scene. Some types of data file support editing, while others are read-only.

The following types of data files are supported directly by the ArcGIS Runtime APIs:

Data file typeData access APILayer APICan query?Can edit?License level
Vector tile packageVector Tile CacheArcGIS Vector Tile LayerNoNoLite
Image tile packageTile CacheImage Tile LayerNoNoLite
Geodatabase

Note this is limited to Runtime geodatabases, typically downloaded as offline data from a feature service, or exported from ArcMap.

GeodatabaseFeature LayerYesYesLite
Scene Layer Package

For display in scenes only

N/A

Access a Scene Layer Package (.slpk) file directly from the ArcGIS Scene Layer

ArcGIS Scene LayerNoNoLite
ShapefileShapefile Feature TableFeature LayerYesYesStandard
Local raster file

The following raster formats are supported: ASRP/USRP, CIB, CADRG/ECRG, DTED, GeoPackage Raster, GeoTIFF/TIFF, HFA, HRE, IMG, JPEG, JPEG2000, Mosaic Dataset in SQLite, NITF, PNG, RPF, SRTM, CRF, and MrSID

RasterRaster LayerNoNoStandard
OGC GeoPackage (feature data)GeoPackage Feature TableFeature LayerYesYesStandard
OGC GeoPackage (raster data)GeoPackage RasterRaster LayerNoNoStandard
OGC KML fileKML DatasetKML LayerNoYesStandard
Electronic Nautical Chart (S-57)

For display in maps only. Not supported in scenes.

ENC CellENC LayerNoNoStandard
Other (e.g. GeoJSON)Feature CollectionFeature Collection LayerYesYesLite

Licensing

Files created by the ArcGIS Platform (vector tile packages, image tile packages, geodatabases, and scene layer packages) can be used with a free Lite license. Files that require custom parsing code and are used with a Feature Collection Layer can also be used with a free Lite license. Other files require a Standard license.

Steps to display the contents of a data file

The typical high level steps to display the geographic contents of a data file are:

  1. Sideload or download the data file to device.
  2. Access the data file with the ArcGIS Runtime API.
  3. Create a layer referencing the data file.
  4. Add the layer to a map or scene.

This document covers steps 2-4.

Examples

Display a shapefile

The steps to display a shapefile are:

  1. Create a Shapefile Feature Table referencing the shapefile in local storage.
  2. Create a Feature Layer with the Shapefile Feature Table.
  3. Add the Feature Layer to a Map displayed in a Map View.
ArcGIS .NET APIArcGIS Android APIArcGIS iOS APIArcGIS Java APIArcGIS Qt API (C++)ArcGIS Qt API (QML)
    
1
2
3
4
var shapefileTable = new ShapefileFeatureTable("\\path\\to\\shapefile.shp");
var shapefileLayer = new FeatureLayer(shapefileTable);

MainMapView.Map.OperationalLayers.Add(shapefileLayer);

Display features from an OGC GeoPackage

The steps to display features in a GeoPackage are:

  1. Create a GeoPackage referencing the GeoPackage file in local storage.
  2. Load the GeoPackage to read its contents.
  3. Get a GeoPackage Feature Table from the GeoPackage Feature Tables collection in the GeoPackage.
  4. Create a Feature Layer with the GeoPackage Feature Table.
  5. Add the Feature Layer to a Map displayed in a Map View.
ArcGIS .NET APIArcGIS Android APIArcGIS iOS APIArcGIS Java APIArcGIS Qt API (C++)ArcGIS Qt API (QML)
               
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
try
{
    var geoPackage = await GeoPackage.OpenAsync("\\path\\to\\geopackage.gpkg");
    await geoPackage.LoadAsync();

    foreach (var table in geoPackage.GeoPackageFeatureTables)
    {
        var featureLayer = new FeatureLayer(table);
        MainMapView.Map.OperationalLayers.Add(featureLayer);
    }
}
catch(Exception ex)
{
    // Handle error
}

To display the geopackage contents in 3D, you can add the Feature Layer to a Scene displayed in a Scene View.

Query features in a shapefile (SQL)

The steps to query features in a shapefile using a SQL where clause are:

  1. Create a Shapefile Feature Table referencing the shapefile in local storage.
  2. Create a Query Parameters object and set a whereClause.
  3. Call Query Features With Parameters on the Shapefile Feature Table.
ArcGIS .NET APIArcGIS Android APIArcGIS iOS APIArcGIS Java APIArcGIS Qt API (C++)ArcGIS Qt API (QML)
                 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
try
{
    var shapefileTable = await ShapefileFeatureTable.OpenAsync("\\path\\to\\shapefile");

    var queryParameters = new QueryParameters { WhereClause = "height < 12" };
    var queryResult = await shapefileTable.QueryFeaturesAsync(queryParameters);

    foreach(var feature in queryResult)
    {
        double height = (double)feature.Attributes["height"];
        // do something with height value
    }
}
catch (Exception ex)
{
    // Handle error
}

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