Data files

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 in a or . Some data files also support editing, querying, and analyzing data. can be created using a number of tools or scripts, or downloaded from the internet.

You use to create that:

  • Display or without a network connection.
  • Can access, display, and analyze data 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.

Types of data files

The following types of are supported directly by the :

Data file typeData access APILayer APICan query?Can edit?License level
Vector Tile CacheArcGIS Vector Tile LayerNoNoLite
Tile CacheMap Tile LayerNoNoLite
Mobile GeodatabaseFeature LayerYesYesLite
Scene Layer PackageAccess a Scene Layer Package (.slpk) file directly from the ArcGIS Scene LayerArcGIS Scene LayerNoNoLite
Shapefile 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 (feature data)GeoPackage Feature TableFeature LayerYesYesStandard
OGC (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

Files created by ArcGIS (, , , 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.

How to work with data files

The general workflow to work with a in an is:

1. Create

To begin working with a , you need to have one of the supported data files. You can either create your own data files using ArcGIS Pro, tools, and scripts, or download public data files from the internet.

When choosing a data file to host in your , make sure that its type is also supported by your license level. A license is needed for when you want to deploy your app to production. Some data files such as , , and are supported by the Lite license, which is the lowest level license. Meanwhile, to use , OGC , files, or local raster files, you need a Basic license.

The typical steps to create a data file are:

  1. Determine the data file you will need in your from the list of supported data files.
  2. Use tools in or the to import dataset.
  3. Export into the desired data file format.

2. Manage

Once you have your , you or download it onto a device. You can then access it directly from local storage. Optionally, you can also include the data file in your application build folder and reference the folder path in your .

The typical steps to manage a data file are:

  1. Transfer the data file onto your device through sideloading or including it in the application build folder.
  2. Keep note of the location path of the data file, since you will need to reference it in the application code.

3. Access

To display a data file in your offline app, you typically start with a that references the shapefile (either in your device or included in the application build), and add the layer to a or .

Once you have your data file displayed in your offline app, you can perform additional capabilities as supported by your file type. Some types of data file support editing, such as and , while others are read-only. Shapefiles and mobile geodatabases also allow you to perform SQL queries on them. Additionally, you can apply a renderer to define symbols for features in the layer. Shapefiles, GeoPackages, and mobile geodatabase tables only have a default renderer with black solid symbols when first applied to a .

The typical steps to access a data file (in this case, a shapefile) are:

  1. Set up your project using one of the for your platform of choice within your preferred IDE.

  2. Create a ShapefileFeatureTable referencing the shapefile in local storage.
  3. Create a FeatureLayer with the ShapefileFeatureTable.
  4. Add the FeatureLayer to a Map displayed in a MapView.

Code examples

Display a shapefile

After you create and manage your (in this case, a shapefile), you can access it in your .

ArcGIS Maps SDK for .NETArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt
1
2
3
4
5
6

var shapefileTable = new ShapefileFeatureTable("\\path\\to\\shapefile.shp");

var shapefileLayer = new FeatureLayer(shapefileTable);

MainMapView.Map.OperationalLayers.Add(shapefileLayer);

Display features from an OGC GeoPackage

After you create and manage your (in this case, an OGC GeoPackage), you can access it in your .

Steps

  1. Set up your project using one of the for your platform of choice within your preferred IDE.

  2. Create a GeoPackage referencing the file in local storage.
  3. Load the GeoPackage to read its contents.
  4. Get a GeoPackageFeatureTable from the GeoPackageFeatureTables collection in the GeoPackage.
  5. Create a FeatureLayer with the GeoPackageFeatureTable.
  6. Add the FeatureLayer to a Map displayed in a MapView.
ArcGIS Maps SDK for .NETArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt
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
}

Query features in a shapefile (SQL)

After you create, manage, and access your shapefile, you can query features in it.

Steps

  1. Create a ShapefileFeatureTable referencing the shapefile in local storage.
  2. Create a QueryParameters object and set a whereClause.
  3. Call QueryFeaturesWithParameters on the ShapefileFeatureTable.
ArcGIS Maps SDK for .NETArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
try
{
    var shapefileTable = await ShapefileFeatureTable.OpenAsync("\\path\\to\\shapefile");

    var queryParameters = new QueryParameters { WhereClause = "Shape__Length > 150" };

    var queryResult = await shapefileTable.QueryFeaturesAsync(queryParameters);

    foreach(var feature in queryResult)
    {
        double shapeLength = (double)feature.Attributes["Shape__Length"];
        // do something with shapeLength value
    }

}
catch (Exception ex)
{
    // Handle error
}

Tutorials

Create a mobile map package

Use ArcGIS Pro to create a mobile map package.


Workflows

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close