koop-provider-quickbase
v1.0.3
Published
Koop Provider that extracts data from Quickbase for use with ArcGIS or other consumers.
Maintainers
Readme
Koop Provider - Quickbase for ArcGIS
Provider Summary | Usage | How To Implement | Usage | Caveats | Todo
View Live Demo
Quick Start
npm install --save @koopjs/koop-core koop-provider-quickbase
// After creating your Koop project files, update
// your Koop index or server js to add this provider
// register the plugin with koop
const provider = require('koop-provider-quickbase')
koop.register(provider)
// Read docs for URL syntax to use the endpoint(s), such as required url query paramsProvider Summary:
Use this provider module with Koop to run a realtime ETL on Quickbase data and access it as a Feature Service meeting the specification to use with ArcGIS and other products or apps.
This is a realtime ETL, allowing you to see changes to the Quickbase data after each app/service reload, or based on a refresh interval!
(Unless caching is used.)
What is Koop? Koop is an open source geospatial data server. It is essentially an Extract-Transform-Load server that lets you pull data from one source and access it as a Geoservice, such as an ArcGIS FeatureLayer or WMS. Clearly your table data must contain geospatial coordinates in a field/column so it can be mapped.
What is Quickbase? Quickbase is a successful low-code PaaS serving both as a cloud-database and app builder. It can be used by developers/testers through the Builder Program if you sign up for an account.
How To Implement:
- Create a Koop project, aka build an instance.
- Download the module and place it within your Koop app/instance.
- Configure Koop to register this provider as a plugin.
- Set up your .env file with token.
- Deploy your Koop app with the module.
- Access the Feature Service endpoint and add to your GIS software.
Usage:
Anatomy of the URL
This applies when using a FeatureLayer URL. WMS is not documented or test yet
- URL Path: From the URL root, the provider lives under the
/quickbasedirectory, but uses conventional Feature Service directory names for the most part. - Quickbase Realm: The provider needs to know the name of your realm to access the data. Place the name right after
/servicesin the path. - App ID & Table ID: The IDs of the app where the table lives, and the ID of the Table itself, must be concatenated using a
-. E.g.../services/qb-realm/abc123-abc456/... - Service Type: The URL contains a type, such as
/FeatureServer, and must also contain the layer ID, such as 0 or 1 when accessing data, such as/FeatureServer/0. In most cases the ID will be 0 since there is one layer (advances could create a more sophisticated system using layer IDs, but does it make sense?). - Query Parameters: (only one is required)
- coords_fid (required): Identify and append the Field ID from Quickbase of the field containing GCS coordinates. e.g.
?coords_fid=9 - Others: Many parameters can be appended if they meet the spec, such as
&inSR=4326&outSR=3857to ensure your web app puts your points at the right location.
- coords_fid (required): Identify and append the Field ID from Quickbase of the field containing GCS coordinates. e.g.
Full Example:
https://domain.host/quickbase/rest/services/quickbase-realm-name/appId-tableId/FeatureServer/0/query?coordinates=9&inSR=4326&outSR=3857
This corresponds to a Quickbase URL of:
https://{quickbase-realm-name}.quickbase.com/nav/app/{appId}/table/{tableId}/
Add Service To An App
Basic Example Using Esri Leaflet
import {featureLayer} from 'esri-leaflet'
const layer = featureLayer({
url: 'https://localhost:8443/quickbase/rest/services/builderprogram-username/bty227quq-bfy86afhg/FeatureServer/0?coords_fid=9&inSR=4326&outSR=3857',
// ^ QB Realm Name ^ App ID ^ Table ID ^ Coordinates FID
useCors: true,
fields: ['*'],
fetchAllFeatures: true,
pointToLayer(feature, latlng) {
return L.circleMarker(latlng, {
radius: 8,
color: 'dodgerblue',
weight: 1,
fillColor: 'dodgerblue',
fillOpacity: 0.3,
})
},
}).addTo(map)
// View your Quickbase data in realtime on the map!Caveats:
- As of the latest testing, the updated Map Viewer in ArcGIS Online is too fickle to accept data from most Koop Providers, including this one.
- Currently only works with Point Geometry!
- You must provide a QB_TOKEN in your .env file generated by your Quickbase user. In the future, a work-around could implemement the ability to access public Quickbase data without a token.
- Some apps will require that your endpoint uses SSL, so for local testing, in those cases, you must run Koop using SSL or proxy the app.
Todo:
- Low priority: Ingest lines or polygons. You would have to accurately store long strings in a Quickbase table.
- Fine tune compatibility with a range of apps, including the new AGOL Map Viewer.
- Test WMS and other service outputs. See List Here
- Implement blocks to catch failures, such as when the spatial data is not a point, for example an array of points.
