raster3d_metadata_table.sql 1.2 KB

123456789101112131415161718192021222324252627282930
  1. --#############################################################################
  2. -- This SQL script generates the raster3d metadata table to store
  3. -- and metadata for SQL queries and temporal GIS support.
  4. --
  5. -- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
  6. --#############################################################################
  7. --PRAGMA foreign_keys = ON;
  8. -- The metadata table reflects most of the raster3d metadata available in grass
  9. CREATE TABLE raster3d_metadata (
  10. id VARCHAR NOT NULL, -- The id (PFK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary foreign key
  11. str3ds_register VARCHAR, -- The name of the table storing all space-time raster3d datasets in which this map is registered
  12. datatype VARCHAR NOT NULL,
  13. cols INTEGER NOT NULL,
  14. rows INTEGER NOT NULL,
  15. depths INTEGER NOT NULL,
  16. number_of_cells INTEGER NOT NULL,
  17. nsres DOUBLE PRECISION NOT NULL,
  18. ewres DOUBLE PRECISION NOT NULL,
  19. tbres DOUBLE PRECISION NOT NULL,
  20. min DOUBLE PRECISION,
  21. max DOUBLE PRECISION,
  22. FOREIGN KEY (id) REFERENCES raster3d_base (id) ON DELETE CASCADE ON UPDATE CASCADE
  23. );
  24. CREATE INDEX raster3d_metadata_index ON raster3d_metadata (id);