Ignore:
Timestamp:
07/10/08 11:12:12 (11 years ago)
Author:
domlowe
Message:

Creating FeatureSet? class to provide query methods on collection of FeatureInstances?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/service/imps/csmlbackend/wfs_csmllayer.py

    r4291 r4292  
    55 
    66from cows.service.imps.csmlbackend.csmlcommon import CSMLLayerMapper, CSMLConnector, BboxAggregator 
    7 from cows.service.wfs_iface import IwfsLayer, IFeatureInstance 
     7from cows.service.wfs_iface import * 
    88import csml 
    99from xml.etree import ElementTree as etree 
     
    4747        #feature *types* not *instances*. However a record of instances is also  
    4848        #needed to fulfil GetFeature requests: 
    49         featureinstances={} #feature instances         
     49        featureset=CSMLFeatureSet() #holds feature instances                 
    5050        layermap={} #feature types        
    5151        bboxAggregators={}#for aggregations of bounding boxes. 
     
    5353        for feature in csml.csmllibs.csmlextra.listify(ds.featureCollection.featureMembers): 
    5454            title, abstract=self._getInfo(feature) 
    55             featureinstances[feature.id]=CSMLFeatureInstance(title, abstract, feature)              
    56         for id, instance in featureinstances.iteritems(): 
     55            featureset.featureinstances[feature.id]=CSMLFeatureInstance(title, abstract, feature)              
     56        for id, instance in featureset.featureinstances.iteritems(): 
    5757            ftype='csml:' + instance.featuretype 
    5858            if ftype not in layermap.keys(): 
     
    7272            #cache results 
    7373            self.layermapcache[fileoruri]=layermap 
    74             self.featureinstancecache[fileoruri]=featureinstances 
    75             return layermap, featureinstances 
     74            self.featureinstancecache[fileoruri]=featureset 
     75            return layermap, featureset 
    7676        else: 
    7777            raise ValueError 
     78 
     79class CSMLFeatureSet(IFeatureSet): 
     80    """ A set of features available via a WFS. Supports querying methods as used by OGG filters """ 
     81    def __init__(self): 
     82        self.featureinstances={} 
     83     
     84    def getFeatureByGMLid(self, gmlid): 
     85        pass 
     86     
    7887 
    7988class CSMLFeatureInstance(IFeatureInstance): 
Note: See TracChangeset for help on using the changeset viewer.