Changeset 4284 for cows/trunk


Ignore:
Timestamp:
06/10/08 11:54:41 (11 years ago)
Author:
domlowe
Message:

adding keywords, outputformats to WFS

Location:
cows/trunk/cows
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/model/wfs.py

    r4278 r4284  
    1111    """ One WfsFeatureSummary corresponds to one data 'layer' e.g. Temperature PointSeries. 
    1212    """ 
    13     def __init__(self, **kw): 
     13    def __init__(self, keywords=[], outputformats=[], **kw): 
    1414        super(WfsFeatureSummary, self).__init__(**kw) 
    15         #TODO: flesh out feature summary 
    16         #Name 
    17         #Abstract 
    18         #Title 
    19         #ows:Keywords, Keyword 
    20         #DefaultSRS 
    21         #OutputFormats, Format 
    22         #ows:WGS84BoundingBox 
     15        self.outputformats=outputformats 
     16        self.keywords = keywords 
     17        #TODO: DefaultSRS 
    2318         
    2419         
  • cows/trunk/cows/pylons/templates/wfs_capabilities_1_1_0.xml

    r4275 r4284  
    4343                <Title py:content="ds.titles[0]"/> 
    4444                <Abstract py:if="len(ds.abstracts)>0" py:content="ds.abstracts[0]"/> 
     45                <ows:Keywords> 
     46                        <ows:Keyword py:for="kw in ds.keywords" py:content="kw"/>                        
     47                </ows:Keywords> 
     48                <OutputFormats> 
     49                        <Format py:for="format in ds.outputformats" py:content="format"/> 
     50                </OutputFormats>                         
     51                <DefaultSRS>WGS:84</DefaultSRS> 
    4552                <CRS py:for="crs in ds.CRSs" py:content="crs"/> 
    4653                <?python exBBox = ds.wgs84BoundingBoxes[0]?> 
     
    126133     
    127134    <FeatureTypeList py:if="c.capabilities.contents is not None"> 
    128       <Title>Contents</Title> 
    129135      <FeatureType py:for="ds in c.capabilities.contents.datasetSummaries" 
    130136             py:replace="markupLayer(ds)"> 
  • cows/trunk/cows/pylons/wfs_controller.py

    r4278 r4284  
    109109#            wgs84BBox = WGS84BoundingBox(['10','20'],['20','40']) 
    110110             
    111             ds = WfsFeatureSummary(identifier=layerName, 
     111            ds = WfsFeatureSummary(keywords=layer.keywords,  
     112                                   outputformats=layer.outputformats,  
     113                                   identifier=layerName, 
    112114                                   titles=[layer.title], 
    113115                                   abstracts=[layer.abstract],                                    
  • cows/trunk/cows/service/imps/csmlbackend/wfs_csmllayer.py

    r4278 r4284  
    55 
    66from cows.service.imps.csmlbackend.csmlcommon import CSMLLayerMapper, CSMLConnector, BboxAggregator 
    7 from cows.service.wfs_iface import IwfsLayer 
     7from cows.service.wfs_iface import IwfsLayer, IFeatureInstance 
    88import csml 
    99 
     
    4949        layermap={} #feature types        
    5050        bboxAggregators={}#for aggregations of bounding boxes. 
    51                
    52         #FIXME: remove feature instances? 
     51 
    5352        for feature in csml.csmllibs.csmlextra.listify(ds.featureCollection.featureMembers): 
    5453            title, abstract=self._getInfo(feature) 
    5554            featureinstances[feature.id]=CSMLFeatureInstance(title, abstract, feature)       
    56             #TODO: convert layermap to hold TYPES 
    5755         
    5856        for id, instance in featureinstances.iteritems(): 
     
    8078            raise ValueError 
    8179 
    82 class CSMLFeatureInstance(object): 
     80class CSMLFeatureInstance(IFeatureInstance): 
    8381    def __init__(self, title, abstract, feature): 
    8482        """ representing a CSML Feature Instance  
     
    109107        #Hardcoding is okay as this is a CSML specific interface, so will only ever deal 
    110108        #with CSML feature types. 
    111         self.wgs84BBox=wgs84bb         
     109        #TODO: However, might be better to move to some sort of schema.cfg file? 
     110        self.wgs84BBox=wgs84bb      
     111        self.outputformats=['text/xml: subtype=csml/2.0']     
    112112        if self.type=='csml:GridSeriesFeature': 
    113113            self.title='GridSeriesFeature as defined in Climate Science Modelling Language.' 
    114114            self.abstract='The CSML GridSeriesFeature is used to represent 4D gridded data such as atmospheric model output.' 
     115            self.keywords=['Grid', 'Climate', 'CSML'] 
    115116        elif self.type=='csml:PointSeriesFeature': 
    116117            self.title='PointSeriesFeature as defined in Climate Science Modelling Language.' 
    117118            self.abstract='The CSML PointSeriesFeature represents a time series of measurements at a single point in space.' 
     119            self.keywords=['Point', 'Timeseries', 'Climate', 'CSML'] 
    118120        #TODO: definitions for all feature types. 
    119121         
  • cows/trunk/cows/service/wfs_iface.py

    r4274 r4284  
    1414    """ 
    1515    An interface representing a WFS FeatureType, based on ILayer. 
    16  
     16    @ivar: list keywords describing this feature type. 
     17    @outputformats: list of output formats available for this feature type. 
    1718    """ 
    18     pass 
     19    keywords=outputformats=NotImplemented 
     20     
    1921         
     22class IFeatureInstance(object): 
     23    """     An interface representing a feature (as defined in a GML application schema) 
     24    @ivar title: title of feature instance 
     25    @ivar abstract: abstract of feature instance  
     26    @ivar feature: feature instance  
     27    """  
     28     
     29    type=title=abstract=NotImplemented 
Note: See TracChangeset for help on using the changeset viewer.