Ignore:
Timestamp:
14/12/06 13:53:25 (13 years ago)
Author:
domlowe
Message:

added AlternatePointFeature and fixed Point Feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/branches/CSML2/csParser.py

    r1846 r1862  
    206206                 
    207207class csString(csElement): 
    208     pass 
    209  
     208    def __init__(self, **kwargs): 
     209        children={} 
     210        addchildren(self,children) 
     211     
    210212class AbstractGML(csElement): 
    211213    def __init__(self, **kwargs): 
     
    292294        addchildren(self,children) 
    293295 
    294 class MultiPoint(csElement): 
    295     def __init__(self, **kwargs): 
     296class MultiPoint(AbstractGML, SRSReferenceGroup,csElement): 
     297    def __init__(self, **kwargs): 
     298        AbstractGML.__init__(self,**kwargs) 
     299        SRSReferenceGroup.__init__(self,**kwargs) 
    296300        children={'pointMember':[GML('pointMember'), 'csString'],'pointMembers':[GML('pointMember'), 'csString']} 
    297         a=['srsDimension'] 
    298         addatts(self,a) 
     301        addchildren(self,children) 
     302 
     303class 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']} 
    299308        addchildren(self,children) 
    300309 
     
    315324        addchildren(self,{}) 
    316325         
     326class Definition(AbstractGML): 
     327    def __init__(self, **kwargs): 
     328        AbstractGML.__init__(self,**kwargs) 
     329        addchildren(self,{}) 
     330 
     331class 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) 
    317337         
    318338class SpatialOrTemporalPositionList(AbstractGML,csElement): 
     
    376396        addchildren(self,children) 
    377397         
     398class 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 
    378405class PointCoverage(AbstractDiscreteCoverage, csElement): 
    379406    def __init__(self, **kwargs): 
     
    382409        addchildren(self,children) 
    383410 
    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) 
     411class 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) 
    401416 
    402417class PointFeature(AbstractFeature, csElement): 
     
    479494        addchildren(self,children) 
    480495 
    481          
    482496class FileExtract(ArrayDescriptor, csElement): 
    483497    def __init__(self,**kwargs): 
     
    491505        children={'variableName':[CSML('variableName'), 'csString']} 
    492506        addchildren(self,children) 
    493          
     507 
    494508class NASAAmesExtract(FileExtract, csElement): 
    495509    def __init__(self,**kwargs): 
     
    501515    def __init__(self,**kwargs): 
    502516        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')]} 
    504518        addchildren(self,children) 
    505519    def _getSubstitutionType(self,tag): 
     
    508522        elif tag==CSML('PointFeature'): 
    509523            return 'PointFeature' 
     524        elif tag==CSML('AlternatePointFeature'): 
     525            return 'AlternatePointFeature' 
    510526        else: return 'AbstractFeature' 
    511527    def _getReverseSubsType(self, typename): 
     
    514530        elif typename == 'PointFeature': 
    515531            return CSML('PointFeature') 
     532        elif typename == 'AlternatePointFeature': 
     533            return CSML('AlternatePointFeature') 
    516534        else: return CSML('AbstractFeature') 
    517535 
     
    521539    def __init__(self, **kwargs): 
    522540        AbstractGML.__init__(self,**kwargs) 
    523         #children = {'ncExtract':[CSML('NetCDFExtract'), 'NetCDFExtract'], 'featureCollection':[CSML('featureCollection') ,'FeatureCollection']} 
    524541        children = {'featureCollection':[GML('FeatureCollection') ,'FeatureCollection'],'fileExtracts':[FILEFORMATS, 'ArrayDescriptor']} 
    525542        addchildren(self,children) 
Note: See TracChangeset for help on using the changeset viewer.