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
You use data files
- Display maps
A map is a collection of layers that are displayed in 2D. It is typically composed of a basemap layer and data layers. or scenesA scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. without a network connection. - Can access, display, and analyze data sideloaded
Sideloading is the process of deploying a file or package to a device without using a network. 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 data files
| Data file type | Data access API | Layer API | Can query? | Can edit? | License level |
|---|---|---|---|---|---|
| Vector tile package | Vector Tile Cache | ArcGI | No | No | Lite |
| Map tile package | Tile Cache | Map Tile Layer | No | No | Lite |
| Mobile geodatabase | Mobile Geodatabase | Feature Layer | Yes | Yes | Lite |
| Scene Layer Package | Access a Scene Layer Package (.slpk) file directly from the ArcGIS Scene Layer | ArcGI | No | No | Lite |
| Shapefile | Shapefile Feature Table | Feature Layer | Yes | Yes | Standard |
| 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. | Raster | Raster Layer | No | No | Standard |
| OGC GeoPackage | Geo | Feature Layer | Yes | Yes | Standard |
| OGC GeoPackage | Geo | Raster Layer | No | No | Standard |
| OGC KML file | KM | KM | No | Yes | Standard |
| Electronic Nautical Chart (S-57) For display in maps only. Not supported in scenes. | EN | EN | No | No | Standard |
| Other (e.g. GeoJSON) | Feature Collection | Feature Collection Layer | Yes | Yes | Lite |
Files created by ArcGIS (vector tile packagesFeature 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 data file
1. Create
To begin working with a data file
When choosing a data file to host in your offline app
The typical steps to create a data file are:
- Determine the data file you will need in your offline app
An offline application, also known as offline app, is an application that runs on a phone, tablet, laptop or desktop device with limited or no network connection. Offline applications are built with ArcGIS Maps SDKs for Native Apps. from the list of supported data files. - Use tools in ArcGIS Pro
ArcGIS Pro is a professional desktop GIS application that can explore, visualize, analyze, and manage 2D and 3D data. or the portalArcGIS portal, also known as a portal, is a website with applications and tools that can be used to create, manage, access, and share geospatial content and data. It supports security and authentication, developer credentials, content and data service management, user and group management, and site administration. A portal can be hosted in Esri's infrastructure or your own infrastructure. to import dataset. - Export into the desired data file format.
2. Manage
Once you have your data file
The typical steps to manage a data file are:
- Transfer the data file onto your device through sideloading or including it in the application build folder.
- 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 layer
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 mobile geodatabases
The typical steps to access a data file (in this case, a shapefile) are:
-
Set up your project using one of the ArcGIS Maps SDKs for Native Apps
ArcGIS Maps SDKs for Native Apps, previously known as ArcGIS Runtime SDKs, are developer products for building mapping and spatial analysis applications for native devices. for your platform of choice within your preferred IDE. - Create a
Shapefilereferencing the shapefile in local storage.Feature Table - Create a
Featurewith theLayer Shapefile.Feature Table - Add the
Featureto aLayer Mapdisplayed in aMap.View
Code examples
Display a shapefile
After you create and manage your data file
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 data file
Steps
-
Set up your project using one of the ArcGIS Maps SDKs for Native Apps
ArcGIS Maps SDKs for Native Apps, previously known as ArcGIS Runtime SDKs, are developer products for building mapping and spatial analysis applications for native devices. for your platform of choice within your preferred IDE. - Create a
Georeferencing the GeoPackagePackage A geopackage is an OGC spatial data storage format that can contain multiple datasets of geographic features, non-spatial tabular data, and raster data. file in local storage. - Load the
Geoto read its contents.Package - Get a
Geofrom thePackage Feature Table Geocollection in thePackage Feature Tables Geo.Package - Create a
Featurewith theLayer Geo.Package Feature Table - Add the
Featureto aLayer Mapdisplayed in aMap.View
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
- Create a
Shapefilereferencing the shapefile in local storage.Feature Table - Create a
Queryobject and set aParameters where.Clause - Call
Queryon theFeatures With Parameters Shapefile.Feature Table
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
}

