Skip to content

Diesel Storage Tanks

Loads petroleum storage tank location data (Petroleum_Storage_Tanks.geojson) into a PostGIS-enabled PostgreSQL database for spatial querying and mapping.

src/diesel_storage_tanks/load.py:

  1. Connects via utils.db.PostgresDBHelper (shared workspace utils package).
  2. setup_postgis_extension — drops/recreates the postgis extension.
  3. create_table — drops/recreates petroleum_storage_tanks (columns: pst_id, lat_dd, long_dd, geometry GEOMETRY, properties JSONB).
  4. validate_geojson — checks the features key and reports invalid/missing geometries.
  5. load_geojson_to_db — bulk-inserts valid features via ST_GeomFromGeoJSON, within a transaction; logs progress/errors with loguru.

Single DVC-tracked source: Petroleum_Storage_Tanks.geojson (see data/registry.yml), registered under data/preprocessed/.

geojson, loguru, shared utils.db.PostgresDBHelper for the Postgres/PostGIS connection.

Ingestion-only; the visualization layer has not been built out yet.