- Timestamp:
- 26/01/07 10:13:07 (14 years ago)
- Location:
- TI02-CSML/trunk/csml
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/csml/parser.py
r2052 r2057 56 56 57 57 #Some variable definitions: these things are often repeated so store in variables. 58 FILEFORMATS=[CSML('NetCDFExtract'),CSML('NASAAmesExtract'), CSML('GRIBExtract'),CSML('CDMLExtract'), CSML('RawFileExtract') ]58 FILEFORMATS=[CSML('NetCDFExtract'),CSML('NASAAmesExtract'), CSML('GRIBExtract'),CSML('CDMLExtract'), CSML('RawFileExtract'), CSML('AggregatedArray')] 59 59 60 60 … … 68 68 if not hasattr(self, 'ATTRIBUTES'): 69 69 self.__dict__['ATTRIBUTES']=[] 70 70 71 71 72 #The __setattr__ and __getattribute__ special methods have been overridden. … … 369 370 def __init__(self, **kwargs): 370 371 AbstractGML.__init__(self,**kwargs) 371 children={} 372 #note __insertedExtract is used in resolving xlinks and shouldn't be written to directly (except by the code which handles the xlink resolutions) 373 children={'__insertedExtract':[FILEFORMATS,'FileExtract']} 372 374 addchildren(self,children) 373 375 a =['uom'] 374 376 addatts(self,a) 375 377 csElement.__init__(self,**kwargs) 378 376 379 377 380 class CompositeValue(AbstractGML,csElement): … … 478 481 def __init__(self, **kwargs): 479 482 AbstractGML.__init__(self,**kwargs) 480 children={'coordinateList':[CSML('coordinateList'),'csString'], 'timePositionList':[CSML('timePositionList'),'TimePositionList'] }483 children={'coordinateList':[CSML('coordinateList'),'csString'], 'timePositionList':[CSML('timePositionList'),'TimePositionList'],'__insertedExtract':[[CSML('NetCDFExtract'),CSML('NASAAmesExtract'),CSML('AggregatedArray')],'FileExtract',CSML('__insertedExtract')]} 481 484 addchildren(self,children) 482 485 a=['frame'] 483 486 addatts(self,a) 484 487 csElement.__init__(self,**kwargs) 488 children={'descriptors':[[CSML('NetCDFExtract'),CSML('AggregatedArray')], 'FileExtract', CSML('descriptor'),1]} 489 490 485 491 486 492 class GridOrdinateDescription(AbstractGML,csElement): … … 795 801 def __init__(self,**kwargs): 796 802 addatts(self,[]) 797 children={'descriptors':[[CSML('NetCDFExtract'),CSML(' PointFeature'),CSML('AggregatedArray')], 'FileExtract', CSML('descriptor'),1]}803 children={'descriptors':[[CSML('NetCDFExtract'),CSML('AggregatedArray')], 'FileExtract', CSML('descriptor'),1]} 798 804 addchildren(self,children) 799 805 csElement.__init__(self,**kwargs) -
TI02-CSML/trunk/csml/parser_extra.py
r2040 r2057 111 111 for sd in csml.csmllibs.csmlextra.listify(self.dataset.storageDescriptor.descriptors): 112 112 if type(sd) in [csml.parser.NetCDFExtract]: 113 print dir(sd)114 print sd113 #print dir(sd) 114 #print sd 115 115 if hasattr(sd, 'id'): 116 print sd116 #print sd 117 117 if sd.id == href: 118 print 'found match' 118 return sd 119 #print 'found match' 120 119 121 120 122 … … 145 147 if hasattr(ordinate.coordAxisValues,'coordinateList'): 146 148 if ordinate.coordAxisValues.coordinateList.CONTENT[:1] == '#': 147 cList= self.__findCLmatch(ordinate.coordAxisValues.coordinateList.CONTENT[1:])148 if cList is not None:149 ordinate.coordAxisValues.coordinateList=cList149 dataforClist= self.__findCLmatch(ordinate.coordAxisValues.coordinateList.CONTENT[1:]) 150 if dataforClist is not None: 151 setattr(ordinate.coordAxisValues, '__insertedExtract', dataforClist) 150 152 break 153 #now the rangeSet: 151 154 152 153 #for feature in self.dataset.featureCollection.featureMembers: 155 #for feature in self.dataset.featureCollection.featureMembers: 154 156 #if hasattr(feature.value.rangeSet, 'valueArray'): 155 157 ##could be an xlink here.. … … 157 159 #if hasattr(vc, 'href'): 158 160 #self.dataset=csml.csmllibs.csmlxlink.resolveXlink(vc, self.dataset) 159 sys.exit()161 # sys.exit() 160 162 return self.dataset -
TI02-CSML/trunk/csml/testfiles/basictest.py
r2052 r2057 34 34 csmldoc = dataset.toXML() 35 35 36 37 #try another iteration: 36 38 #Tidy up and print the CSML document: 37 39 #strCSML= parseString(tostring(csml)).toprettyxml()
Note: See TracChangeset
for help on using the changeset viewer.