Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Accessing GeoPackage data via ArcGIS Pro
ArcGIS Pro (version 1.1 or later)
A GeoPackage dataset
Certain versions of ArcPro (for example, version 2.5) require GeoPackages to have a spatial index added before the data can be viewed on the map. This can be done in the Catalog by opening the Feature Class Properties window within the 'Indexes' page.
These instructions were created using ArcGIS Pro version 2.5, but versions from 1.1 onwards will support GeoPackage.
Start ArcGIS Pro, then open an existing project or create a new one. To create a new project, select Map from the Blank Templates section, then enter a Name and a Location for the project in the Create a New Project section. Click OK.
In the ribbon at the top of the project, select Map > Add Data.
A dialog box will appear. Navigate to the GeoPackage to be added into ArcGIS Pro. Select the GeoPackage and click Open. This will open the GeoPackage to reveal the individual layers.
The layers can be selected either individually or together. Once the relevant layers have been selected, click OK. The selected layers will then be added into ArcGIS Pro.
More than one layer can be selected at any time by holding down the Ctrl (control) key and clicking on multiple layers.
The layers added into ArcGIS Pro will appear in the contents pane on the left-hand side of the project.
Accessing GeoPackage data via CadCorp
CadCorp SIS (version SIS 9 or later)
A GeoPackage dataset
These instructions were created using CadCorp SIS 9 Desktop Express; however all versions of CadCorp SIS 9 or later support GeoPackage.
Start CadCorp SIS.
In the upper ribbon, select Add Overlay.
A dialog box will appear. Select Files > File.
From here, another dialog box appears where you can map to where the GeoPackage has been stored locally.
Once the correct GeoPackage has been located, click Finish.
The data should now appear on the map.
Accessing GeoPackage data via ArcMap
ArcMap (version 10.2.2 or later)
A GeoPackage dataset
Certain versions of ArcMap (for example, version 10.8.1) require GeoPackages to have a spatial index added before the data can be viewed on the map. This can be done in the Catalog by opening the Feature Class Properties window within the 'Indexes' page.
These instructions were created using ArcMap version 10.7, but versions from 10.2.2 onwards will also support GeoPackage features.
Open ArcMap.
Once ArcMap loads, select the Add Data button, which can be found in the ribbon at the top of the workspace.
Once you have connected to the appropriate folder, locate the GeoPackage to upload into ArcMap. The GeoPackage file will look similar to the one in the following screenshot:
Double-click on the GeoPackage file to reveal the layers within it. Select the layers you want to upload into ArcMap.
More than one layer can be selected at any time by holding down the Ctrl (control) key and clicking on multiple layers.
Add the relevant selected GeoPackage layers into the map by clicking the Add button.
The GeoPackage layers should now be viewable in the layers list in the Table Of Contents on the left-hand side of the workspace.
Accessing GeoPackage data via MapInfo Professional
MapInfo Professional (version 15.2 or later)
A GeoPackage dataset
These instructions were completed using MapInfo Professional version 2019; however, any version from 15.2 onwards can be used.
Start MapInfo Professional.
Select Open > Table in the top ribbon.
A dialog box will appear where you can search for the appropriate GeoPackage. Once located, select the GeoPackage and click Open.
Another dialog box will appear. Here, it is possible to select which layers to import into MapInfo Professional from the GeoPackage.
Once the layers have been selected, click OK.
The data should now be available in your workspace.
Accessing GeoPackage data via QGIS
QGIS (version 2.10.1 or later)
A GeoPackage dataset
These instructions were created using QGIS version 3.22. Other versions of QGIS can be used, from version 2.10.1 onwards.
Open a new or existing QGIS project.
On the top ribbon of the workspace, add a layer by selecting Layer > Add Layer > Add Vector Layer.
The Data Source Manager - Vector dialog box will appear. Here, it is possible to select the GeoPackage that will be loaded using the three dots button located next to the Vector Dataset(s) box. Click the three dots button.
Navigate to the GeoPackage. Double-click the file or select it, then click Add.
A separate dialog box will appear. Here, the layers of the GeoPackage can be selected and added to a map. It is possible to add selected layers, numerous layers or all layers.
Once the relevant layers have been selected, click OK.
The GeoPackage layers should now be viewable in the layers list on the left-hand side of the workspace.
Reading GeoPackage data via FME
FME is a data integration platform which can read the GeoPackage format and be used to convert and transform the data into other formats or databases. The below example shows how to read a GeoPackage into an FME workbench.
FME Desktop
An FME license
A GeoPackage dataset
Start up FME. In the top ribbon, click the Add Reader button, which will look similar to the following image:
A dialog box will appear. Here, the format (OGC GeoPackage in this instance) can be specified using the drop-down list. Select the three dots button next to Dataset to specify which GeoPackage you want to read. The Coordinate System should also be set appropriately.
Click Parameters…
Another dialog box will appear. Here, specific layers within the GeoPackage can be selected, rather than importing the entire file. Additionally, the Search Envelope can be used to clip the GeoPackage to an extent.
Click the three dots button next to the Tables drop-down menu.
The next dialog box to appear allows for the selection of specific layers. Here, it is possible to select which themes / layers should be added into the workbench.
Click OK.
An orange reader will appear which will display the name of the GeoPackage table that has been ‘read in’.
GeoPackage (.gpkg) is an open, non-proprietary, platform-independent, and standard data format for geographic information systems (GIS), as defined by the Open Geospatial Consortium (OGC). It is designed to be a lightweight format that can contain large amounts of varied and complex data in a single, easy to distribute and ready to use file. GeoPackage is natively supported by numerous software applications.
GeoPackage offers users the following key features and benefits:
The single file is easy to transfer and offers the end-user a rich experience.
Attribute names are not limited in length, making the format user-friendly.
The file size limit is very large at 140 TB, so lots of data can be easily accommodated (please note that a file size limit may be imposed by the file system to which the file is written).
It supports raster, vector and database formats, making it a highly versatile solution.
It is an OGC standard.
In most cases, it is a plug and play format.
Data will be supplied in British National Grid (ESPG:27700), World Geodetic System (WGS84: EPSG: 4326), or British National Grid + ODN Height (EPSG: 7405), depending on your selection when ordering OS NGD data.
The following sub-sections provide step-by-step instructions on how to access GeoPackage data via various GIS software packages, all current versions of these support GeoPackages natively.
It is possible to use Extract, Transform, Load (ETL) tools to convert the data into different formats and to load into databases.
In the OS NGD GeoPackages, the column ordering is slightly different to those listed on the individual feature types pages, and therefore the OS NGD CSV files.
The first column is an additional fid
attribute, which is an INTEGER NOT NULL
column. This acts as a primary key and is a requirement of the OGC GeoPackage specification.
Additionally, the geometry column will always be the second column; however, the attribute, or its value, isn't usually visible in GIS software.
The remaining ordering of columns will match the attribute listings on the feature types pages.
Using GDAL to load a GeoPackage into a database
GDAL is a translator library for raster and vector geospatial data formats that is released under an X/MIT style Open Source License by the Open Source Geospatial Foundation. It comes with a variety of useful command line utilities for data translation and processing. The following section covers the loading of GeoPackage datasets into a PostgreSQL database using the ETL tool GDAL. The process will be similar for other databases such as Oracle and SQL Server, as well as converting to other data formats.
A PostgreSQL database with PostGIS extension enabled
GDAL version 1.11.0 or above (with access to a command line interface to use it)
A GeoPackage dataset
You can interrogate a GeoPackage dataset using the ogrinfo program which lists information about it. At a basic level it will return the layers contained within it:
ogrinfo
<PATH_TO_GEOPACKAGE>
Using the ‘Summary Only’ (-so
) and ‘List all features of all layers’ (-al
) arguments you can view summary information about all the layers within the GeoPackage, including projection, schema, feature count and extents:
ogrinfo
<PATH_TO_GEOPACKAGE>
-so -al
The GeoPackage can be loaded into a PostgreSQL database using the ogr2ogr program, the below will load all layers from the source GeoPackage into the specified target schema in the database:
ogr2ogr -f PostgreSQL "PG:user=
<USERNAME>
password=
<PASSWORD>
dbname=
<DATABASENAME>
host=
<HOST>
port=
<PORTNUMBER>
active_schema=
<TARGETSCHEMA>
"
<PATHTOGEOPACKAGE>
<USERNAME>, <PASSWORD>, <DATABASENAME>, <HOST>, <PORTNUMBER> are the connection details of the target PostgreSQL database.
<TARGETSCHEMA> is the schema in the database that the layers should be loaded into. If this doesn’t exist or if it is omitted, they will be loaded into the default schema, the default is usually the ‘public’ schema.
Will create two tables in the example_schema
schema:
Different loading options (including renaming tables, reprojecting the data, etc.) can be found on the PostgreSQL / PostGIS — GDAL documentation page.