- Timestamp:
- 10/08/06 15:23:02 (13 years ago)
- Location:
- TI02-CSML/trunk/Scanner
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/Scanner/csmllibs/csmlbuilder.py
r1342 r1380 16 16 #this class contains all the method calls to create and populate a csmldoc 17 17 #it needs to be provided with several bits of information to be able to do this. 18 def __init__(self,directory,csmlft, mapping, timedimension ,outputfile,printscreen ):18 def __init__(self,directory,csmlft, mapping, timedimension ,outputfile,printscreen,timestorage,spatialstorage,valuestorage): 19 19 self.directory = directory # top level directory containing data files 20 20 self.csmlfeaturetype = csmlft … … 23 23 self.outputfile=outputfile 24 24 self.printscreen=printscreen 25 self.timestorage=timestorage 26 self.spatialstorage=spatialstorage 27 self.valuestorage=valuestorage 25 28 self.csml = None # csml object holds the csml document in memory. 26 29 self.ds_element = None #<Dataset> tag, root node. … … 88 91 def makeFileExtracts(self): 89 92 print "make FEs" 90 feBuilder =csmllibs.csmlfileextracts.fileExtractBuilder( self.ds, self.ffmap) 91 #self.csml = feBuilder.csmldoc 92 self.ds = feBuilder.dataset_element 93 #todo, remember ds == dataset_element in this file 94 self.extractType = feBuilder.extractType 95 self.extractPrefix = feBuilder.extractPrefix 96 self.extractDictionary=feBuilder.fileExtractDictionary 93 if self.spatialstorage=='fileextract': 94 feBuilder =csmllibs.csmlfileextracts.fileExtractBuilder( self.ds, self.ffmap, self.timedimension) 95 self.ds = feBuilder.dataset_element 96 self.extractType = feBuilder.extractType 97 self.extractPrefix = feBuilder.extractPrefix 98 self.extractDictionary=feBuilder.fileExtractDictionary 97 99 98 100 def createFeatureCollection(self): -
TI02-CSML/trunk/Scanner/csmllibs/csmlfeaturetypes.py
r1352 r1380 370 370 #create a file extract link for long lists 371 371 arraySize=len(measuredvalues)*len(listOfFiles) 372 #TODO this needs to be able to handle inline, use VALUESTORAGE to determine which to use: 372 373 fextract=csmllibs.csmlfileextracts.createSingleExtract(self.extractType,filenames,allVarNames[i],arraySize) 373 374 qlist = csmllibs.Parser.MeasureOrNullList(val=fextract) -
TI02-CSML/trunk/Scanner/csmllibs/csmlfileextracts.py
r1154 r1380 6 6 import sys 7 7 class fileExtractBuilder: 8 def __init__(self, dataset_element, ffmap ):8 def __init__(self, dataset_element, ffmap, timedim): 9 9 self.dataset_element=dataset_element 10 10 self.ffmap=ffmap 11 self.createFileExtracts() 12 13 def createFileExtracts(self): 14 #print "REPRESENTATIVE FILES:" 15 #print self.ffmap.getRepresentativeFiles() 16 17 #given a featurefilemap object, create file extracts from the "representativeFiles" 18 #used to store extract/filename/variable relationship 19 #referenced when creating features 20 self.fileExtractDictionary={} 21 11 self.fileExtractDictionary={} #used to store extract/filename/variable relationship 12 self.createFileExtractsForAxes() 13 14 def createFileExtractsForAxes(self): 15 #given a featurefilemap object, create file extracts for the axes from the "representativeFiles" 16 22 17 fileid=0 #used to distinguish extract names for similar variables from different files 23 18 #adlist is an empty list object to hold CSML ArrayDescriptors eg. NetCDFExtract, GRIBExtract etc … … 26 21 fileid=fileid+1 27 22 filename=repfile.getRepresentativeFileName() 28 #print 'representative file:'29 #print repfile.getRepresentativeFileName()30 #print 'feature type:'31 #print repfile.getFeatureType()32 23 DI = csmllibs.csmldataiface.DataInterface() 33 24 DI = DI.getUnknownInterfaceType(filename) … … 39 30 allDimNames=DI.getListOfAxes() 40 31 numDomains=len(allDimNames) 32 print allDimNames 41 33 for j in range (0, len(allDimNames)): 42 # print self.extractType43 # print self.extractPrefix44 34 if self.extractType=='NASAAmesExtract': 45 35 arrayDescriptor=csmllibs.Parser.NASAAmesExtract() -
TI02-CSML/trunk/Scanner/csmlscan.py
r1379 r1380 108 108 MAPPING=None 109 109 TIMEDIMENSION=None 110 TIMESTORAGE='inline' 111 VALUESTORAGE='fileextract' 112 SPATIALSTORAGE='fileextract' 113 110 114 #... 111 115 if hasConfig == True: … … 119 123 SRSNAME = config.getConfigNoError('SpatialReference', 'srs') 120 124 TIMEDIMENSION=config.getConfigNoError('time','timedimension') 125 TIMESTORAGE=config.getConfigNoError('time','timestorage') 126 VALUESTORAGE=config.getConfigNoError('values','valuestorage') 127 SPATIALSTORAGE=config.getConfigNoError('spatialaxes','spatialstorage') 121 128 122 129 if configTest==True: … … 133 140 print '\n SpatialReference:srs =%s'%SRSNAME 134 141 print '\n time:timedimension =%s'%TIMEDIMENSION 142 print '\n time:timestorage =%s'%TIMESTORAGE 143 print '\n spatialaxes:spatialstorage =%s'%SPATIALSTORAGE 144 print '\n values:valuestorage =%s'%VALUESTORAGE 135 145 sys.exit() 136 146 … … 172 182 #build CSML document 173 183 print ROOTDIRECTORY 174 csmldataset=csmllibs.csmlbuilder.csmlBuilder(ROOTDIRECTORY,FEATURETYPE,MAPPING,TIMEDIMENSION, OUTPUTFILE, PRINTSCREEN )184 csmldataset=csmllibs.csmlbuilder.csmlBuilder(ROOTDIRECTORY,FEATURETYPE,MAPPING,TIMEDIMENSION, OUTPUTFILE, PRINTSCREEN,TIMESTORAGE,SPATIALSTORAGE,VALUESTORAGE) 175 185 csmldataset.build() 176 186 -
TI02-CSML/trunk/Scanner/sampleconfig.cfg
r1379 r1380 9 9 printscreen:1 10 10 11 [spatialaxes] 12 spatialstorage:inline 13 14 [values] 15 valuestorage:fileextract 16 11 17 [SpatialReference] 12 18 srs: EPSG 4326 … … 14 20 [time] 15 21 timedimension: t 22 timestorage:inline 16 23 17 24 [outputfile]
Note: See TracChangeset
for help on using the changeset viewer.