Quickstart
From zero to a materialized AGOL layer in four steps.
PostgreSQL 15+, PostGIS 3+, PL/Python 3 (plpython3u), and pgcrypto. Optionally ogr_fdw for live reads.
-- required extensions in your database
CREATE EXTENSION postgis;
CREATE EXTENSION plpython3u;
CREATE EXTENSION pgcrypto;
-- optional, for live reads:
-- CREATE EXTENSION ogr_fdw;
pip install agol_fdw
CREATE EXTENSION agol_fdw;
# encryption key for stored AGOL secrets (give it to the PG process)
export AGOL_FDW_KEY="<32-byte-key>"
SELECT agol_fdw.register_credentials(
client_id := '<client-id>',
client_secret := '<client-secret>'
);
SELECT agol_fdw.materialize_layer(
layer_url := 'https://services.arcgis.com/.../FeatureServer/0',
layer_name := 'poles',
target_schema := 'data'
);
You now have data.poles as a real PostGIS table with full geodatabase semantics, populated from ArcGIS Online.