dbio module

Module for interfacing with the PostGIS database

dbio.columnExists(dbname, schemaname, tablename, colname)[source]

Tests whether a column exists in a table.

dbio.connect(dbname)[source]

Connect to database dbname.

dbio.createResampledCatalog(dbname)[source]

Create catalog that holds information on resampled rasters.

dbio.createResampledTables(dbname, sname, tname, dt, tilesize, overwrite, squery='')[source]

Cache resampled tables by using materialized views.

dbio.deleteRasters(dbname, tablename, dt, squery='')[source]

If date already exists delete associated rasters before ingesting, and optionally constrain with subquery.

dbio.getResampledTables(dbname, options, res)[source]

Find names of resampled raster tables.

dbio.ingest(dbname, filename, dt, stname, resample=True, overwrite=True)[source]

Imports Geotif filename into database db.

dbio.resampleRaster(dbname, sname, tname, dt, res, method, tilesize, overwrite, squery='')[source]

Resample raster to target resolution.

dbio.schemaExists(dbname, schemaname)[source]

Check if schema exists in database.

dbio.tableExists(dbname, schemaname, tablename)[source]

Check if table exists in the database.

dbio.writeGeotif(lat, lon, res, data, filename=None)[source]

Writes Geotif in temporary directory so it can be imported into the PostGIS database.