#!/bin/sh ############################################################################ # # AUTHOR(S): Soeren Gebbert soerengebbert gmx de # PURPOSE: grass temporal data management # COPYRIGHT: (C) 2007 by the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS # for details. # ############################################################################# #%Module #% description: Register or Update raster maps in the grass sqlite database #% keywords: raster, database #%End #%option #% key: input #% type: string #% gisprompt: old,cell,raster #% description: Raster map to register or update #% required : yes #% multiple: no #%END #%option #% key: vtime_end #% type: string #% description: End validity time of raster map (start time is taken from raster map timestamp) #% answer: +10 years #% required : no #% multiple: no #%END #Only run if started in GRASS if [ -z "$GISBASE" ] ; then echo "You must be in GRASS GIS to run this program." exit 1 fi #Parse the arguments, if g.parser not work, skip the test's if [ "$1" != "@ARGS_PARSED@" ] ; then exec g.parser "$0" "$@" if [ $? -ne 0 ] ; then echo "g.parser failed, no Test available" exit 1 fi fi # source some library functions ### setup enviro vars ### eval `g.gisenv` : ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?} source ${GISBASE}/etc/r.rast4d/lib/insert_raster.sh echo $GIS_OPT_INPUT # create/update the table entries for i in `echo $GIS_OPT_INPUT | sed s/,/\ /g` ; do echo "processing map $i" insert_raster_map $i insert_raster_map_metadata $i insert_raster_map_time $i "$GIS_OPT_END_TIME" done exit 0