Changeset 2901 for TI02-CSML


Ignore:
Timestamp:
21/09/07 15:53:57 (12 years ago)
Author:
domlowe
Message:

added option to pass dataset ID to csml scanner; use config option of form: [dataset] dsID:myIDabc123

Location:
TI02-CSML/trunk/csml
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/csmllibs/csmlbuilder.py

    r2758 r2901  
    66    #this class contains all the method calls to create and populate a csmldoc 
    77    #it needs to be provided with several bits of information to be able to do this. 
    8     def __init__(self,directory,csmlft, mapping, timedimension ,outputfile,printscreen,timestorage,spatialstorage,valuestorage): 
     8    def __init__(self,datasetid, directory,csmlft, mapping, timedimension ,outputfile,printscreen,timestorage,spatialstorage,valuestorage): 
     9        if datasetid is not None: 
     10            self.datasetid = datasetid 
     11        else: 
     12            self.datasetid =csml.csmllibs.csmlextra.getRandomID() 
    913        self.directory = directory # top level directory containing data files  
    1014        self.csmlfeaturetype  = csmlft  
     
    4751        self.ds = csml.parser.Dataset() 
    4852        #Use random id for dataset id. 
    49         setattr(self.ds,'id',csml.csmllibs.csmlextra.getRandomID())         
     53        setattr(self.ds,'id',self.datasetid)         
    5054        setattr(self.ds, 'name', csml.parser.csString('NAME OF DATASET GOES HERE')) 
    5155        ######################################## 
  • TI02-CSML/trunk/csml/csmlscan.py

    r2427 r2901  
    117117    if hasConfig == True: 
    118118        config.read(configfile) 
     119        DATASETID = config.getConfigNoError('dataset', 'dsID') 
    119120        FEATURETYPE = config.getConfigNoError('features', 'type') 
    120121        FEATURENUMBER = config.getConfigNoError('features', 'number') 
     
    134135            print '\n' 
    135136            print 'The following config options have been set:' 
     137            print '\n dataset:dsID =%s'%DATASETID 
    136138            print '\n features:type =%s'%FEATURETYPE 
    137139            print '\n features:number =%s'%FEATURENUMBER 
     
    184186    #build CSML document 
    185187    print ROOTDIRECTORY 
    186     csmldataset=csmllibs.csmlbuilder.csmlBuilder(ROOTDIRECTORY,FEATURETYPE,MAPPING,TIMEDIMENSION, OUTPUTFILE, PRINTSCREEN,TIMESTORAGE,SPATIALSTORAGE,VALUESTORAGE) 
     188    csmldataset=csmllibs.csmlbuilder.csmlBuilder(DATASETID,ROOTDIRECTORY,FEATURETYPE,MAPPING,TIMEDIMENSION, OUTPUTFILE, PRINTSCREEN,TIMESTORAGE,SPATIALSTORAGE,VALUESTORAGE) 
    187189    csmldataset.build() 
    188190 
  • TI02-CSML/trunk/csml/testfiles/gridseries/testGSconfig.cfg

    r2356 r2901  
     1[dataset] 
     2dsID: myIDabc123 
     3 
    14[features] 
    25type: GridSeries 
Note: See TracChangeset for help on using the changeset viewer.