One of my favorite things about Fulcrum is that your data is always yours. I am impressed by how much work the engineering team puts into trying to make it almost as easy to get your data out of Fulcrum as it is to get your data in.
To that end, Fulcrum supports numerous output formats and a few ways to get your data out of our infrastructure and into yours. With this post, I’d like to focus on one output format, the OGC GeoPackage, and two methods to create GeoPackage data from Fulcrum.
The GeoPackage is an Open Geospatial Consortium specification for encoding vector, raster, and tiled geospatial data in a SQLite container. In simpler terms, it defines a common SQLite schema implementation to allow any geospatial client to discover and access the data in the databases without further external assistance.
When the new Fulcrum editor interface was introduced in March of 2017, support for GeoPackage export was included. Exporting a GeoPackage from the editor is one method we will explore today. The other is syncing your data directly from Fulcrum using the Fulcrum Desktop tool.
Let’s start with the browser-based Fulcrum Editor. For this post, I’ll be working with data sets that were created for Spatial Networks’ recent participation in FOSS4G 2017 in Boston.
Downloading GeoPackage data from the Fulcrum editor is very straightforward. Simply open your data set in the editor, select the “Download Data” button in the upper right, and choose “GeoPackage” as the output format in the options dialog. When you click “Start,” your data will be downloaded as a GeoPackage.
From here, you can begin using your data in GeoPackage-literate GIS software, such as QGIS, or perform analysis in any other environment capable of accessing SQLite, such as R. In the screenshot below, we are browsing the Culvert Inventory data set in DB Browser for SQLite. Because the data was built using the strict GeoPackage option, there are no dependencies on external libraries, such as SpatiaLite.
If you’re not familiar with Fulcrum Desktop, it is a new command-line utility that was introduced in the summer of 2017 to enable direct sync of Fulcrum data into your organizational infrastructure. It was designed to be scriptable, eliminating the need for manual exports and it uses the same syncing approach as the core Fulcrum infrastructure, so subsequent syncs are differential and save processing time and bandwidth. In order to support multiple destinations, Fulcrum Desktop was designed with a plug-in architecture to allow support for additional data stores to be added over time.
Using Fulcrum Desktop to create a GeoPackage is a bit more involved than the export process described above, but it is also more powerful.
After completing the installation and initial configuration of Fulcrum Desktop (see the link above), we simply need to install the GeoPackage plug-in with the following command:
> fulcrum install-plugin --name geopackage
Next, we need to initialize the GeoPackage database to which our data will be synced. Remember that, for this post, I am using the Spatial Networks ‘FOSS4G’ account. You should use your own account name.
> fulcrum geopackage --org ‘FOSS4G’
This will initialize an empty GeoPackage database in your operating-system-specific home directory. To get data into the GeoPackage is a two-step process. First, Fulcrum Desktop needs to sync into its local system database with the following command:
> fulcrum sync --org ‘FOSS4G’
You will see command-line output similar to the following as Fulcrum Desktop syncs your account contents locally.
Finally, we sync our data into the GeoPackage with the same command we used to initialize the GeoPackage:
> fulcrum geopackage --org ‘FOSS4G’
This last command causes your data to be transferred from the Fulcrum Desktop system database into the GeoPackage. Using more advanced Fulcrum Desktop options, some shell scripting, and task scheduling, you can keep your local data up to date as your collection teams work with Fulcrum. It’s also worth noting that the separate Fulcrum Desktop media plug-in can be used to keep your photos and videos in sync on your file system while your GeoPackage stores your vector data. Here is our Culvert Inventory data being displayed in QGIS.
The GeoPackage standard provides a powerful, lightweight means of storing and analyzing geospatial data across a wide range of tools and platforms. As we have just seen, Fulcrum makes it easy for you to take advantage of GeoPackage as a means to work with and share your field-collected data within your own team or with your external users.