Changeset 4695 for cows


Ignore:
Timestamp:
20/12/08 10:40:57 (11 years ago)
Author:
domlowe
Message:

Merging WCS branch back into cows trunk

Location:
cows/trunk/cows
Files:
4 edited
5 copied

Legend:

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

    r4008 r4695  
    1212 
    1313 
    14 from cows.contents import Contents, DatasetSummary 
    15 from cows.domain import Domain 
     14from cows.model.contents import Contents, DatasetSummary 
     15from cows.model.domain import Domain 
    1616 
    1717class WcsDatasetSummary(DatasetSummary): 
     
    2020    def __init__(self, CRSs=[], description=None, formats=[],supportedCRSs=[],timelimits=[],**kw): 
    2121        super(WcsDatasetSummary, self).__init__(**kw) 
    22  
    2322        self.CRSs = CRSs 
    2423        self.description=description 
     
    2726        self.timeLimits=timelimits 
    2827 
    29  
    30 class FormattedURL(object): 
     28class CoverageDescription(WcsDatasetSummary):  
    3129    """ 
    32     @ivar format 
    33     @type format: str 
    34     @ivar onlineResource 
    35     @type onlineResource: OnlineResource object 
    36  
     30    Further extends WCSDatasetSummary to provide a fuller coverage description 
     31    used in DescribeCoverageResponse. Building up this extra information may require more  
     32    work on the servers part, hence this is separate class from the simpler WcsDatasetSummary. 
    3733    """ 
    38     def __init__(self, format, onlineResource): 
    39         self.format = format 
    40         self.onlineResource = onlineResource 
    41  
    42  
    43 class Dimension(Domain): 
    44     """ 
    45     Use Domain attributes where possible. 
    46      
    47     @ivar multipleValues 
    48     @type multipleValues: boolean (default False) 
    49     @ivar nearestValue 
    50     @type nearestValue: boolean (default False) 
    51     @ivar current 
    52     @type current: boolean (default False) 
    53  
    54     """ 
    55     def __init__(self, multipleValues=False, nearestValue=False, 
    56                  current=False, *kw): 
    57         super(Dimension, self).__init__(**kw) 
    58          
    59         self.multipleValues = multipleValues 
    60         self.nearestValue = nearestValue 
    61         self.current = current 
    62  
    63  
    64 # 
    65 #!TODO: Other objects referenced by WmsDatasetSummary 
    66 # 
     34    def __init__(self, **kw): 
     35        super(CoverageDescription, self).__init__(**kw) 
     36#       TODO, add DescribeCoverage extensions 
  • cows/trunk/cows/service/imps/csmlbackend/csmlcommon.py

    r4352 r4695  
    66import logging 
    77import csml 
     8import tempfile 
    89from pylons import config, request, session  #config must have tmpfilebuffer and csmlstore values 
    910import ConfigParser 
     
    1718 
    1819from cows.service.wxs_iface import ILayerMapper 
     20 
     21def extractToNetCDF(feature, sel, publish=False): 
     22    """ 
     23       performs the CSML subset and returns a filename of the netcdf extract 
     24       publish flag is used to indicate that the netcdf file should be made available to the webserver (for asynchronous delivery) 
     25    """ 
     26 
     27    if publish: 
     28        #if publishing to download directory is required, do so and return publishable file name 
     29        #used e.g. in WCS when "STORE = true" 
     30        extract_dir=config['publish_dir'] 
     31    else: 
     32        extract_dir = config['tmpfilebuffer'] 
     33          
     34    # Subset the feature 
     35    (fd, filename) = tempfile.mkstemp('.nc', 'csml_wxs_', extract_dir); os.close(fd) 
     36    if type(feature) is csml.parser.GridSeriesFeature: 
     37        feature.subsetToGridSeries(ncname=os.path.basename(filename), outputdir=os.path.dirname(filename) ,**sel) 
     38    elif type(feature) is csml.parser.TrajectoryFeature: 
     39        feature.subsetToTrajectory(ncname=os.path.basename(filename), outputdir=os.path.dirname(filename) ,**sel) 
     40    elif type(feature) is csml.parser.PointSeriesFeature: 
     41        del sel['longitude'] #delete dummy values 
     42        del sel['latitude'] #delete dummy values 
     43        feature.subsetToPointSeries(ncname=os.path.basename(filename), outputdir=os.path.dirname(filename) ,**sel) 
     44    elif type(feature) is csml.parser.RaggedSectionFeature: 
     45        del sel['longitude'] #delete dummy values 
     46        del sel['latitude'] #delete dummy values 
     47        feature.subsetByTime(ncname=os.path.basename(filename), outputdir=os.path.dirname(filename) ,**sel) 
     48    return filename 
     49 
    1950 
    2051class CSMLLayerMapper(ILayerMapper): 
     
    3162     
    3263    def getInfo(self, feature): 
    33         ''' given a csml feature, return basic info about the layer/feature 
     64        ''' given a csml feature, return basic info about the layer/feature/coverage 
    3465        @return:   title, abstract''' 
    3566 
  • cows/trunk/cows/service/imps/csmlbackend/wfs_csmllayer.py

    r4534 r4695  
    2020    Supports the retrieval of sets of layers according to arbitrary 
    2121    keyword/value pairs. 
    22     Implements  ILayerMapper  
     22    Implements  ILayerMapper (does it? TODO: check) 
    2323     
    2424    WFS differs from WMS/WCS in that the 'layers' are feature types, not instances. 
  • cows/trunk/cows/service/imps/wms_layers.py

    r4266 r4695  
    11""" 
    22implementation of ILayerMapper, ILayer, IDimension, ILayerSlab interfaces, as defined in wms_iface.py 
    3  
     3this implementation was written to read station data. 
    44""" 
    55import os 
Note: See TracChangeset for help on using the changeset viewer.