vector_metadata_table.sql 1.7 KB

1234567891011121314151617181920212223242526272829303132
  1. --#############################################################################
  2. -- This SQL script generates the vector table to store
  3. -- 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
  9. CREATE TABLE vector_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. stvds_register VARCHAR, -- The name of the table storing all space-time vector datasets in which this map is registered
  12. is_3d BOOLEAN, -- This is 1 if the vector map is 3d and 0 otherwise
  13. points INTEGER, -- The number of points
  14. lines INTEGER, -- The number of lines
  15. boundaries INTEGER, -- The number of boundaries
  16. centroids INTEGER, -- The number of centroids
  17. faces INTEGER, -- The number of faces
  18. kernels INTEGER, -- The number of kernels
  19. primitives INTEGER, -- All primitives accumulated (points, lines,boundaries,centroids,faces,kernels)
  20. nodes INTEGER, -- Number of nodes (topological information)
  21. areas INTEGER, -- The number of areas (topological information)
  22. islands INTEGER, -- The number of islands (topological information)
  23. holes INTEGER, -- The number of holes (topological information)
  24. volumes INTEGER, -- The number of volumes (topological information)
  25. FOREIGN KEY (id) REFERENCES vector_base (id) ON DELETE CASCADE ON UPDATE CASCADE
  26. );
  27. CREATE INDEX vector_metadata_index ON vector_metadata (id);