Fulcrum Query API and Koop

I don’t write code as much as I used to, but I have to return to it every so often to keep my sanity. With the current world situation, there are a lot of dashboards going up, many of which are based on the Esri Operations Dashboard or ArcGIS Hub.

I got thinking about a previous crisis in which Fulcrum and Esri’s Koop were used to great effect and started wondering if I could make the interaction between the two easier. Koop, at its core, takes GeoJSON and transforms it to be consumed by clients that can handle ArcGIS feature services.

Fulcrum has two primary ways to expose data as GeoJSON feeds – data shares and the Fulcrum Query API. Koop has a provider that handles arbitrary GeoJSON feeds quite well. It can be found here. In order to use that provider with Fulcrum, the only option is to use Fulcrum data shares. That works really well, but data shares have a couple of drawbacks. First, they are always public. Second, there is a limit to the number of shares that can be enabled from an account. Third, the data is shared all or nothing, so columns cannot be filtered.

If you need more control over your data, the Query API (QAPI) is a better option for sharing GeoJSON. It fully participates in the Fulcrum security model and, as a sandboxed SQL API, allows you to filter the columns and rows returned through the API. In theory, the GET option of the QAPI would be usable with the existing provider, but QAPI URLs can get unwieldy quickly. Since I have some extra time to sling some code, I opted to modify it to make it easier to use Koop to serve data via the Fulcrum QAPI into Esri-literate clients.

Ironically, I don’t have a license of ArcGIS Pro or Desktop to use, so I tested this using the “ArcGisFeatureServer” client capability of QGIS. As can be seen above, it worked fine.

To use this provider, there are a couple of prerequisites, mostly on the Fulcrum side. First, you need a Fulcrum subscription with the developer pack, in order to get access to the QAPI. Then you’ll need to create a Fulcrum API and put it in the config file. Also, you’ll need to define one or more queries and put them in the config file. All of that is documented in the repo.

I forked the repo from the original provider, to which I was pointed by Daniel Fenton of Esri. You’ll find some artifacts related to Docker, Lambda, and other more advanced deployments. Those may or may not work right now. I intend to get around to touching them to make sure they do at some point, but take them with a big grain of salt right now.

Finally, though I work at Fulcrum, this is not an official Fulcrum project in any way. This is just me slinging code recreationally in my free time. Fulcrum won’t be able to support this at all.