[GRASS-SVN] r60532 - grass/branches/releasebranch_7_0/lib/temporal/SQL
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 28 04:08:28 PDT 2014
Author: huhabla
Date: 2014-05-28 04:08:28 -0700 (Wed, 28 May 2014)
New Revision: 60532
Modified:
grass/branches/releasebranch_7_0/lib/temporal/SQL/stds_map_register_table_template.sql
grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stds_spatial_temporal_extent_template.sql
grass/branches/releasebranch_7_0/lib/temporal/SQL/update_str3ds_metadata_template.sql
grass/branches/releasebranch_7_0/lib/temporal/SQL/update_strds_metadata_template.sql
grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stvds_metadata_template.sql
Log:
New map register naming scheme to avoid no-SQL compliant mapset names as column name
Modified: grass/branches/releasebranch_7_0/lib/temporal/SQL/stds_map_register_table_template.sql
===================================================================
--- grass/branches/releasebranch_7_0/lib/temporal/SQL/stds_map_register_table_template.sql 2014-05-28 08:36:11 UTC (rev 60531)
+++ grass/branches/releasebranch_7_0/lib/temporal/SQL/stds_map_register_table_template.sql 2014-05-28 11:08:28 UTC (rev 60532)
@@ -11,7 +11,7 @@
-- GRASS_MAP is a placeholder for specific map type: raster, raster3d or vector
-- This table stores the.ids of the GRASS_MAP maps registered in the current spacetime GRASS_MAP table
-CREATE TABLE SPACETIME_NAME_GRASS_MAP_register (
+CREATE TABLE SPACETIME_REGISTER_TABLE (
id VARCHAR NOT NULL, -- This colum is a primary key storing the registered GRASS_MAP map.ids
PRIMARY KEY (id)
);
Modified: grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stds_spatial_temporal_extent_template.sql
===================================================================
--- grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stds_spatial_temporal_extent_template.sql 2014-05-28 08:36:11 UTC (rev 60531)
+++ grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stds_spatial_temporal_extent_template.sql 2014-05-28 11:08:28 UTC (rev 60532)
@@ -7,7 +7,7 @@
-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
--#############################################################################
--- SPACETIME_NAME is a placeholder for specific stds name (SQL compliant): name_mapset
+-- SPACETIME_REGISTER_TABLE is a placeholder for specific stds map register table name (SQL compliant)
-- SPACETIME_ID is a placeholder for specific stds id: name at mapset
-- GRASS_MAP is a placeholder for specific map type: raster, raster3d or vector
-- STDS is a placeholder for specific space-time dataset type: strds, str3ds, stvds
@@ -16,52 +16,52 @@
-- UPDATE STDS_base SET revision = (revision + 1) WHERE id = 'SPACETIME_ID';
-- Number of registered maps
UPDATE STDS_metadata SET number_of_maps =
- (SELECT count(id) FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT count(id) FROM SPACETIME_REGISTER_TABLE)
WHERE id = 'SPACETIME_ID';
-- Update the temporal extent
UPDATE STDS_absolute_time SET start_time =
(SELECT min(start_time) FROM GRASS_MAP_absolute_time WHERE GRASS_MAP_absolute_time.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_absolute_time SET end_time =
(SELECT max(end_time) FROM GRASS_MAP_absolute_time WHERE GRASS_MAP_absolute_time.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_relative_time SET start_time =
(SELECT min(start_time) FROM GRASS_MAP_relative_time WHERE GRASS_MAP_relative_time.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_relative_time SET end_time =
(SELECT max(end_time) FROM GRASS_MAP_relative_time WHERE GRASS_MAP_relative_time.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
-- Update the spatial extent
UPDATE STDS_spatial_extent SET north =
(SELECT max(north) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_spatial_extent SET south =
(SELECT min(south) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_spatial_extent SET east =
(SELECT max(east) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_spatial_extent SET west =
(SELECT min(west) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_spatial_extent SET top =
(SELECT max(top) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_spatial_extent SET bottom =
(SELECT min(bottom) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE STDS_spatial_extent SET proj =
(SELECT min(proj) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN
- (SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
Modified: grass/branches/releasebranch_7_0/lib/temporal/SQL/update_str3ds_metadata_template.sql
===================================================================
--- grass/branches/releasebranch_7_0/lib/temporal/SQL/update_str3ds_metadata_template.sql 2014-05-28 08:36:11 UTC (rev 60531)
+++ grass/branches/releasebranch_7_0/lib/temporal/SQL/update_str3ds_metadata_template.sql 2014-05-28 11:08:28 UTC (rev 60532)
@@ -4,49 +4,49 @@
-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
--#############################################################################
--- SPACETIME_NAME is a placeholder for specific stds name (SQL compliant): name_mapset
+-- SPACETIME_REGISTER_TABLE is a placeholder for specific stds map register table name (SQL compliant)
-- SPACETIME_ID is a placeholder for specific stds id: name at mapset
-- Update the min and max values
UPDATE str3ds_metadata SET min_min =
(SELECT min(min) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET min_max =
(SELECT max(min) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET max_min =
(SELECT min(max) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET max_max =
(SELECT max(max) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
-- Update the resolution
UPDATE str3ds_metadata SET nsres_min =
(SELECT min(nsres) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET nsres_max =
(SELECT max(nsres) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET ewres_min =
(SELECT min(ewres) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET ewres_max =
(SELECT max(ewres) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET tbres_min =
(SELECT min(tbres) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE str3ds_metadata SET tbres_max =
(SELECT max(tbres) FROM raster3d_metadata WHERE raster3d_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster3d_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
Modified: grass/branches/releasebranch_7_0/lib/temporal/SQL/update_strds_metadata_template.sql
===================================================================
--- grass/branches/releasebranch_7_0/lib/temporal/SQL/update_strds_metadata_template.sql 2014-05-28 08:36:11 UTC (rev 60531)
+++ grass/branches/releasebranch_7_0/lib/temporal/SQL/update_strds_metadata_template.sql 2014-05-28 11:08:28 UTC (rev 60532)
@@ -4,40 +4,40 @@
-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
--#############################################################################
--- SPACETIME_NAME is a placeholder for specific stds name (SQL compliant): name_mapset
+-- SPACETIME_REGISTER_TABLE is a placeholder for specific stds map register table name (SQL compliant)
-- SPACETIME_ID is a placeholder for specific stds id: name at mapset
-- Update the min and max values
UPDATE strds_metadata SET min_min =
(SELECT min(min) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE strds_metadata SET min_max =
(SELECT max(min) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE strds_metadata SET max_min =
(SELECT min(max) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE strds_metadata SET max_max =
(SELECT max(max) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
-- Update the resolution
UPDATE strds_metadata SET nsres_min =
(SELECT min(nsres) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE strds_metadata SET nsres_max =
(SELECT max(nsres) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE strds_metadata SET ewres_min =
(SELECT min(ewres) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE strds_metadata SET ewres_max =
(SELECT max(ewres) FROM raster_metadata WHERE raster_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_raster_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
Modified: grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stvds_metadata_template.sql
===================================================================
--- grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stvds_metadata_template.sql 2014-05-28 08:36:11 UTC (rev 60531)
+++ grass/branches/releasebranch_7_0/lib/temporal/SQL/update_stvds_metadata_template.sql 2014-05-28 11:08:28 UTC (rev 60532)
@@ -5,55 +5,55 @@
-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
--#############################################################################
--- SPACETIME_NAME is a placeholder for specific stds name (SQL compliant): name_mapset
+-- SPACETIME_REGISTER_TABLE is a placeholder for specific stds map register table name (SQL compliant)
-- SPACETIME_ID is a placeholder for specific stds id: name at mapset
-- Update the vector features and topology
UPDATE stvds_metadata SET points =
(SELECT sum(points) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET lines =
(SELECT sum(lines) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET boundaries =
(SELECT sum(boundaries) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET centroids =
(SELECT sum(centroids) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET faces =
(SELECT sum(faces) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET kernels =
(SELECT sum(kernels) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET primitives =
(SELECT sum(primitives) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET nodes =
(SELECT sum(nodes) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET areas =
(SELECT sum(areas) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET islands =
(SELECT sum(islands) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET holes =
(SELECT sum(holes) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
) WHERE id = 'SPACETIME_ID';
UPDATE stvds_metadata SET volumes =
(SELECT sum(volumes) FROM vector_metadata WHERE vector_metadata.id IN
- (SELECT id FROM SPACETIME_NAME_vector_register)
- ) WHERE id = 'SPACETIME_ID';
\ No newline at end of file
+ (SELECT id FROM SPACETIME_REGISTER_TABLE)
+ ) WHERE id = 'SPACETIME_ID';
More information about the grass-commit
mailing list