You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Display rasters and features from local GeoPackages.
3
+
Add rasters and feature tables from a GeoPackage to a map.
4
4
5
-

5
+

6
+
7
+
## Use case
8
+
9
+
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.
6
10
7
11
## How to use the sample
8
12
9
-
The layers in the geoPackage, which have not been added to the map are shown in the bottom list. Click an item to show it as a layer in the map. Layers in the map are listed in the top list. Click layers from the top list to remove them from the map.
13
+
When the sample loads, the feature layers and rasters from the GeoPackage will be shown on the map.
10
14
11
15
## How it works
12
16
13
-
To read layers from a geoPackage and show them in a map:
14
-
15
-
1. Create a `GeoPackage` with the path to the local geoPackage file.
16
-
2. Load the `GeoPackage` with `GeoPackage.loadAsync`.
17
-
3. Create raster layers for each of these with `new RasterLayer(geoPackageRaster)`.
18
-
4. Add each layer to the map as an operational layer with `map.getOperationalLayers().add(layer)`.
19
-
5. When it's done loading, get the `GeoPackageFeatureTable`s inside with `geoPackage.getGeoPackageFeatureTables()`.
20
-
6. For each feature table, create a feature layer with `new FeatureLayer(featureTable)`.
21
-
7. You can also get the `GeoPackageRaster`s inside using `GeoPackage.getGeoPackageRasters()`.
17
+
1. Get the GeoPackage and load it using `geoPackage.loadAsync()`.
18
+
2. Iterate through available rasters, exposed by `geopackage.getGeoPackageRasters()`. For each raster, create a raster layer using `new RasterLayer(geopackageRaster)`, then add it to the map.
19
+
3. Iterate through available feature tables, exposed by `geopackage.getGeoPackageFeatureTables()`. For each feature table, create a feature layer using `new FeatureLayer(geopackageFeatureTable)`, then add it to the map.
22
20
23
21
## Relevant API
24
22
25
-
* ArcGISMap
26
-
* Basemap
27
-
* FeatureLayer
28
23
* GeoPackage
29
-
* Layer
30
-
* MapView
31
-
* RasterLayer
24
+
* GeoPackageRaster
25
+
* GeoPackageFeatureTable
26
+
27
+
## Offline data
28
+
29
+
Find this item on [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=68ec42517cdd439e81b036210483e8e7).
30
+
31
+
## About the data
32
+
33
+
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).
34
+
35
+
## Additional information
36
+
37
+
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.
0 commit comments