Just as layers in your app can use data sourced from online services, such as ArcGIS Online, WFS, or WMS services, layers can also use data from data files A data file is a stand-alone file containing geographic data that can be sideloaded on to a device. It is typically used in offline applications that never connect to a network. Learn more stored locally on your user’s device. Local data files support scenarios where your users never have a network connection.

This page describes what you can do with data files and lists supported data file formats. It also provides details on how to use a data file in your app, which are summarized in the following steps:

  1. Create, sideload Sideloading is the process of deploying a file or package to a device without using a network. Learn more , or download the data file A data file is a stand-alone file containing geographic data that can be sideloaded on to a device. It is typically used in offline applications that never connect to a network. Learn more onto your user’s device.
  2. Access the data file A data file is a stand-alone file containing geographic data that can be sideloaded on to a device. It is typically used in offline applications that never connect to a network. Learn more .
  3. Create a layer A layer is a reference to a collection of geographic data that is used to access and display data. The data for layers are typically provided by the basemap layer service and data services. Learn more referencing the data file A data file is a stand-alone file containing geographic data that can be sideloaded on to a device. It is typically used in offline applications that never connect to a network. Learn more .
  4. Apply a renderer A renderer is a collection of rules and symbols used to display the data in a layer. Learn more to define symbols A symbol defines the properties used to display a geometry or text. Learn more for features in the layer (Optional).
  5. Add the layer A layer is a reference to a collection of geographic data that is used to access and display data. The data for layers are typically provided by the basemap layer service and data services. Learn more to a map A map is a collection of layers that are displayed in 2D. It is typically composed of a basemap layer and data layers. Learn more or scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more .

For information on mobile map packages and mobile scene packages, which are also stand-alone files, see Offline maps, scenes, and data or the ArcGIS Pro topics Share a mobile map package and Share a mobile scene package. For details on working with data from services while offline, see Work with offline data.

What you can do with data files

You can do the following types of things in your app using local data files:

  • Display maps or scenes without a network connection.
  • Access, display, and analyze geospatial data.
  • Include data with the installation of your app.
  • Collect data on devices that never have access to a network connection.
  • Create new mobile geodatabases, tables, and domains.
  • Share datasets between applications using peer-to-peer technology.

Supported data file formats

The following data files are supported:

Data file typeData access APILayer APICan query?Can edit?License level
Vector tile package A vector tile package, also known as a VTPK, is a read-only data file containing static tiles of vector data. Learn more VectorTileCacheArcGISVectorTiledLayerNoNoLite
Image tile package An map tile package, formerly known as image tile package, is a read-only data file containing static, pre-rendered map tiles. Learn more TileCacheArcGISTiledLayer, ArcGISTiledElevationSourceNoNoLite
Mobile geodatabase A mobile geodatabase (.geodatabase) is a spatial data storage format in a single file on disk that can store, query, and manage spatial and nonspatial data. In applications built with the ArcGIS Maps SDKs for Native Apps, mobile geodatabases can be used in offline workflows when taking maps and features offline from services or in desktop-based scenarios as standalone mobile geodatabases from ArcGIS Pro. Learn more . You can create a mobile geodatabase file (SQLite database) with this API, using ArcGIS Pro, or by downloading offline data from a feature service.GeodatabaseFeatureLayerYesYesLite
Scene layer package. For display in scenes only.N/A. Access a Scene Layer Package (.slpk) file directly from the ArcGIS Scene Layer.ArcGISSceneLayerNoNoLite
Shapefile A shapefile is a vector data storage format that contains geometry and attribute data for geographic features. It can also include spatial and non-spatial indexes. Learn more ShapefileFeatureTableFeatureLayerYesYesStandard
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.RasterRasterLayerNoNoStandard
OGC GeoPackage A geopackage is an OGC spatial data storage format that can contain multiple datasets of geographic features, non-spatial tabular data, and raster data. Learn more (feature data)GeoPackageFeatureTable()FeatureLayerYesYesStandard
OGC GeoPackage A geopackage is an OGC spatial data storage format that can contain multiple datasets of geographic features, non-spatial tabular data, and raster data. Learn more (raster data)GeoPackageRasterRasterLayerNoNoStandard
OGC KML file (.kml file or compressed .kmz file)KmlDatasetKmlLayerNoYesStandard
Electronic Nautical Chart (S-57). For display in maps only. Not supported in scenes.EncCellEncLayerNoNoStandard
Other (e.g. GeoJSON)FeatureCollectionFeatureCollectionLayerYesYesLite

Vector tile package

Vector tiled layers contain vector representations of data across a range of scales. Unlike raster tiles, they can adapt to the resolution of their display device as you zoom in and out.

When you create a vector tile package, it must be in the same spatial reference as the map in which it will be displayed.

To use a local vector tile package (.vtpk file) with your app, copy or sideload the .vtpk file onto the device into your app’s documents folder, and then instantiate a vector tiled layer, ArcGISVectorTiledLayer, with the following code:

// Path to the vector tile cache package (.vtpk file) on the device file system.
val vectorTileCachePath =
context.getExternalFilesDir(null)?.path + File.separator + getString(context, R.string.app_name) + File.separator + "myVectorTileCache.vtpk"
// Create a VectorTileCache instance with the vector tile cache package.
val cache = VectorTileCache(vectorTileCachePath)
// Use the vector tile cache to create an ArcGISVectorTiledLayer.
val tiledLayer = ArcGISVectorTiledLayer(cache)
// Create a new basemap with the tiled layer, and create an ArcGISMap with that basemap.
// Display the map by assigning it to the mutable map property used by the Composable MapView.
map = ArcGISMap(Basemap(tiledLayer))

Image tile package

Image tiled layers are typically used to display pregenerated tiled data as basemaps A basemap is the foundational layer and data that provides the overall visual and geographic context for a map or scene. It typically includes geographic features and labels for land, water, roads, buildings, cities, places, and administrative boundaries, but can also include raster data such as satellite and areal images. Learn more . A tile cache can also be used to provide offline elevation data for visualizing 3D terrain in a scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more . You can take a portion of tiled data and store it within a single tile package (.tpk or .tpkx) file for completely disconnected scenarios. To store a portion of tile data as a tile package A tile package is a tiled layer that has been bundled into a single .tpk/.tpkx file. The file contains a tile cache of the data and metadata about the layer, packaged into a single, portable file. Learn more , you must specify area of interest, the tiling scheme, the levels of detail, and the tile format using the following approach:

When you create a tile package, it must have the same spatial reference as the map in which it will be displayed.

To create a tiled layer from a tile package file, instantiate an ArcGISTiledLayer object with the path to the tile package file on the device.

// Create a vector tile cache from the local data.
val cache = TileCache(imageTileCachePath)
// Use the tile cache to create an ArcGISTiledLayer.
val tiledLayer = ArcGISTiledLayer(cache)
// Create a new basemap with the tiled layer, and create an ArcGISMap with that basemap.
// Display the map by assigning it to the mutable map property used by the Composable MapView.
map = ArcGISMap(Basemap(tiledLayer))

Create elevation source from tile package

To create an elevation source from a tile package file, instantiate an ArcGISTiledElevationSource object with the path to the tile package file on the device.

// Path to the local package (.tpkx or .tpkx file).
val elevationTilesPath = context.getExternalFilesDir(null)?.path + File.separator + getString(context, R.string.app_name) + File.separator + "MontereyElevation.tpkx"
// Create a tile cache from the local data.
val elevationCache = TileCache(elevationTilesPath)
// Use the tile cache to create an ArcGISTiledElevationSource.
val localElevationSource = ArcGISTiledElevationSource(elevationCache)
// Create a surface with the elevation source.
val elevationSurface = Surface().apply {
// Add the elevation source to the surface
elevationSources.add(localElevationSource)
}
val arcGISScene = ArcGISScene(BasemapStyle.ArcGISImageryStandard).apply {
// Set the elevation surface as the base surface of the scene.
baseSurface = elevationSurface
}
// Display the new scene by updating the mutable scene property used by the Composable MapView.
scene = arcGISScene

Feature layer

Feature layers allow you to display, select, edit, and query individual features and their attributes. You can work with features offline using features stored in a data file, such as a mobile geodatabase file (.geodatabase), a GeoPackage file (.gpkg), or a shapefile (.shp). You can edit feature geometry A geometry is a geometric shape, such as a point, polyline, or polygon, that contains one or more coordinates and a spatial reference. Learn more and attributes Attributes are fields and values for a single feature or non-spatial record. They are typically stored in a database or service such as a feature service. Learn more , and, when using a mobile geodatabase A mobile geodatabase (.geodatabase) is a spatial data storage format in a single file on disk that can store, query, and manage spatial and nonspatial data. In applications built with the ArcGIS Maps SDKs for Native Apps, mobile geodatabases can be used in offline workflows when taking maps and features offline from services or in desktop-based scenarios as standalone mobile geodatabases from ArcGIS Pro. Learn more , can also edit attachments An attachment is a file, such as a photograph (for example, a .png file) or a document, that is associated with individual features in a geodatabase or feature layer. Learn more and related records.

Mobile geodatabase

Mobile geodatabases A mobile geodatabase (.geodatabase) is a spatial data storage format in a single file on disk that can store, query, and manage spatial and nonspatial data. In applications built with the ArcGIS Maps SDKs for Native Apps, mobile geodatabases can be used in offline workflows when taking maps and features offline from services or in desktop-based scenarios as standalone mobile geodatabases from ArcGIS Pro. Learn more (.geodatabase) can be created with ArcGIS Pro 2.7 or later. At version 100.14, they can also be created with this SDK.

To create a mobile geodatabase that you can sideload Sideloading is the process of deploying a file or package to a device without using a network. Learn more for use in your app:

To create a mobile geodatabase with this SDK:

  • Use the companion object function Geodatabase.create() to create a new geodatabase at the provided path.

To display tables from a mobile geodatabase:

  1. Instantiate the Geodatabase object by opening an existing geodatabase or creating a new one. In either case, you need to specify a path to the .geodatabase file.
  2. Instantiate a FeatureTable from one of the mobile geodatabase’s tables or create a new one using a TableDescription and associated FieldDescription objects and calling Geodatabase.createTable().
  3. Create a new FeatureLayer from the feature table and add it to the map. Optionally, create a new Renderer to symbolize features in the layer. If the layer is based on a new geodatabase table, nothing will appear in the layer until features are created.
val localGeodatabasePath =
context.getExternalFilesDir(null)?.path + File.separator + getString(context, R.string.app_name) + File.separator + "LA_Trails.geodatabase"
// Instantiate GeoDatabase with the path to the .geodatabase file.
val geodatabase = Geodatabase(localGeodatabasePath)
coroutineScope.launch {
geodatabase.load().onSuccess {
// Access the feature table named "Trailheads" in the geodatabase.
val featureTable = geodatabase.getFeatureTable("Trailheads")
?: return@launch logErr("Feature table not found in geodatabase.")
// Create a feature layer from the geodatabase feature table.
val featureLayer = FeatureLayer.createWithFeatureTable(featureTable)
// Add the feature layer to the mutable map's operational layers used by the MapView composable.
map.operationalLayers.add(featureLayer)
}.onFailure { error ->
return@launch logErr("Mobile geodatabase failed to load. ${error.message}")
}
}

GeoPackage

GeoPackage is an open, standards-based, platform-independent, portable, self-describing, compact format for transferring geospatial information. It uses a single SQLite file (.gpkg) that conforms to the OGC GeoPackage standard. You can create a GeoPackage file from your own data using the Create SQLite Database tool in ArcGIS Pro.

To display features stored in a GeoPackage file, you must do the following:

  1. Instantiate a GeoPackage with the .gpkg file path.
  2. Load the GeoPackage and then examine its list of GeoPackageFeatureTable()s.
  3. Create a FeatureLayer from one of the GeoPackageFeatureTable()s and add it as an operational layer to the map.
// Get the path to a geoPackage on the device file system.
val localGeoPackagePath =
context.getExternalFilesDir(null)?.path + File.separator + getString(context, R.string.app_name) + File.separator + "AuroraCO.gpkg"
// Instantiate the geopackage with the file path.
val geoPackage = GeoPackage(localGeoPackagePath)
coroutineScope.launch {
// Load the geopackage.
geoPackage.load().onSuccess {
// Get the first feature table in the GeoPackage.
val geoPackageFeatureTable = geoPackage.geoPackageFeatureTables.first()
// Create a feature layer with the feature table.
val featureLayer = FeatureLayer.createWithFeatureTable(geoPackageFeatureTable)
// Add the new layer to the map.
map.operationalLayers.add(featureLayer)
}.onFailure { error ->
logErr("Error loading geopackage: ${error.message}")
}
}

Shapefiles

A shapefile A shapefile is a vector data storage format that contains geometry and attribute data for geographic features. It can also include spatial and non-spatial indexes. Learn more is a vector data storage format that contains geometry and attribute data for geographic features. Despite the name, a shapefile dataset is composed of at least three physical files: .shp, .dbf, and .shx. A shapefile may include several other files, such as projection information, spatial indices, attribute indices, and so on.

To create a feature layer from a shapefile (.shp), do the following:

  1. Instantiate the ShapefileFeatureTable with the path to the shapefile. This path must point to the .shp file. The .shp file’s associated files (.shx, .dbf, and so on) must be present at the same location.

  2. Create a FeatureLayer from the ShapefileFeatureTable and add it to the map.

If you have copied the shapefiles into the app’s documents directory, you can instantiate a feature layer.

// Get the path to a shapefile on the device file system.
val localShapeFilePath =
context.getExternalFilesDir(null)?.path + File.separator + getString(context, R.string.app_name) + File.separator + "ScottishWildlifeTrust_ReserveBoundaries_20201102.shp"
// Create a shapefile feature table using the path.
val shapeFileTable = ShapefileFeatureTable(localShapeFilePath)
coroutineScope.launch {
shapeFileTable.load().onSuccess {
// Create a feature layer from the shapefile feature table.
val featureLayer = FeatureLayer.createWithFeatureTable(shapeFileTable)
// Adds the new layer to the map.
map.operationalLayers.add(featureLayer)
}.onFailure { error ->
logErr("Error loading shapefile: ${error.message}")
}
}

Raster layer

Raster data consists of a matrix of cells in which each individual cell contains a value representing information. You can visualize this raster data by defining specific renderers. Several raster formats are supported that allow you to use data from satellite and aerial images or photographs, for example. To work offline, copy the raster data onto your device and add the raster dataset to your app using the Raster class. For more information and a list of supported raster formats, Add raster data.