Changeset 1862 for TI02CSML/branches/CSML2/csParser.py
 Timestamp:
 14/12/06 13:53:25 (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

TI02CSML/branches/CSML2/csParser.py
r1846 r1862 206 206 207 207 class csString(csElement): 208 pass 209 208 def __init__(self, **kwargs): 209 children={} 210 addchildren(self,children) 211 210 212 class AbstractGML(csElement): 211 213 def __init__(self, **kwargs): … … 292 294 addchildren(self,children) 293 295 294 class MultiPoint(csElement): 295 def __init__(self, **kwargs): 296 class MultiPoint(AbstractGML, SRSReferenceGroup,csElement): 297 def __init__(self, **kwargs): 298 AbstractGML.__init__(self,**kwargs) 299 SRSReferenceGroup.__init__(self,**kwargs) 296 300 children={'pointMember':[GML('pointMember'), 'csString'],'pointMembers':[GML('pointMember'), 'csString']} 297 a=['srsDimension'] 298 addatts(self,a) 301 addchildren(self,children) 302 303 class Point(AbstractGML,SRSReferenceGroup,csElement): 304 def __init__(self, **kwargs): 305 AbstractGML.__init__(self,**kwargs) 306 SRSReferenceGroup.__init__(self,**kwargs) 307 children={'pos':[GML('pos'), 'csString'],'coordinates':[GML('coordinates'), 'csString']} 299 308 addchildren(self,children) 300 309 … … 315 324 addchildren(self,{}) 316 325 326 class Definition(AbstractGML): 327 def __init__(self, **kwargs): 328 AbstractGML.__init__(self,**kwargs) 329 addchildren(self,{}) 330 331 class Phenomenon(Definition,AssociationAttributeGroup): 332 def __init__(self, **kwargs): 333 Definition.__init__(self,**kwargs) 334 AssociationAttributeGroup.__init__(self,**kwargs) 335 children = {'':[CSML(''), '']} 336 addchildren(self,children) 317 337 318 338 class SpatialOrTemporalPositionList(AbstractGML,csElement): … … 376 396 addchildren(self,children) 377 397 398 class AlternatePointCoverage(AbstractDiscreteCoverage, csElement): 399 def __init__(self, **kwargs): 400 AbstractDiscreteCoverage.__init__(self,**kwargs) 401 children={'alternatePointDomain':[GML('Point'),'Point', CSML('alternatePointDomain')], 'rangeSet':[GML('rangeSet'), 'RangeSet'],'coverageFunction':[GML('coverageFunction'),'csString']} 402 addchildren(self,children) 403 print self.CHILDREN 404 378 405 class PointCoverage(AbstractDiscreteCoverage, csElement): 379 406 def __init__(self, **kwargs): … … 382 409 addchildren(self,children) 383 410 384 class Definition(AbstractGML): 385 def __init__(self, **kwargs): 386 AbstractGML.__init__(self,**kwargs) 387 addchildren(self,{}) 388 389 class Phenomenon(Definition,AssociationAttributeGroup): 390 def __init__(self, **kwargs): 391 Definition.__init__(self,**kwargs) 392 AssociationAttributeGroup.__init__(self,**kwargs) 393 children = {'':[CSML(''), '']} 394 addchildren(self,children) 395 396 #class AlternatePointFeature(AbstractFeature, csElement): 397 #def __init__(self, **kwargs): 398 #AbstractFeature.__init__(self,**kwargs) 399 #children={} 400 #addchildren(self,children) 411 class AlternatePointFeature(AbstractFeature, csElement): 412 def __init__(self, **kwargs): 413 AbstractFeature.__init__(self,**kwargs) 414 children={'location':[CSML('location'), 'csString'],'time':[CSML('time'), 'csString'], 'value':[CSML('AlternatePointCoverage'), 'AlternatePointCoverage', CSML('value')], 'parameter':[CSML('parameter'), 'Phenomenon']} 415 addchildren(self,children) 401 416 402 417 class PointFeature(AbstractFeature, csElement): … … 479 494 addchildren(self,children) 480 495 481 482 496 class FileExtract(ArrayDescriptor, csElement): 483 497 def __init__(self,**kwargs): … … 491 505 children={'variableName':[CSML('variableName'), 'csString']} 492 506 addchildren(self,children) 493 507 494 508 class NASAAmesExtract(FileExtract, csElement): 495 509 def __init__(self,**kwargs): … … 501 515 def __init__(self,**kwargs): 502 516 AbstractFeatureCollection.__init__(self,**kwargs) 503 children={'members':[[CSML('GridFeature'),CSML('PointFeature') ], 'AbstractFeature', GML('featureMembers')]}517 children={'members':[[CSML('GridFeature'),CSML('PointFeature'),CSML('AlternatePointFeature')], 'AbstractFeature', GML('featureMembers')]} 504 518 addchildren(self,children) 505 519 def _getSubstitutionType(self,tag): … … 508 522 elif tag==CSML('PointFeature'): 509 523 return 'PointFeature' 524 elif tag==CSML('AlternatePointFeature'): 525 return 'AlternatePointFeature' 510 526 else: return 'AbstractFeature' 511 527 def _getReverseSubsType(self, typename): … … 514 530 elif typename == 'PointFeature': 515 531 return CSML('PointFeature') 532 elif typename == 'AlternatePointFeature': 533 return CSML('AlternatePointFeature') 516 534 else: return CSML('AbstractFeature') 517 535 … … 521 539 def __init__(self, **kwargs): 522 540 AbstractGML.__init__(self,**kwargs) 523 #children = {'ncExtract':[CSML('NetCDFExtract'), 'NetCDFExtract'], 'featureCollection':[CSML('featureCollection') ,'FeatureCollection']}524 541 children = {'featureCollection':[GML('FeatureCollection') ,'FeatureCollection'],'fileExtracts':[FILEFORMATS, 'ArrayDescriptor']} 525 542 addchildren(self,children)
Note: See TracChangeset
for help on using the changeset viewer.