Changeset 2689
- Timestamp:
- 03/07/07 12:14:23 (14 years ago)
- Location:
- TI05-delivery/ows_framework/trunk/ows_server/ows_server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wcs.py
r2681 r2689 131 131 #get doc from cache or disk: 132 132 c.dataset = csmlCache[fileoruri] 133 if type(c.dataset) is str: 134 #If not a csml datset is some message from exist such as 'access denied' 135 return Response(c.dataset) 133 136 return self._renderCapabilities('ows/wcs_capabilities') 134 137 … … 137 140 @parameter('Version', possibleValues=['1.1.0'], required=True) 138 141 @parameter('Identifier', required=True) 139 @parameter('BoundingBox', required=True, validator=V.bbox_2 d)142 @parameter('BoundingBox', required=True, validator=V.bbox_2or3d) 140 143 @parameter('TimeSequence',required=True, validator=V.iso8601_time) 141 144 @parameter('Format', possibleValues=['application/netcdf'], required=True) 142 145 @parameter('Store', validator = V.boolean('Store')) 143 146 @parameter('Status', validator = V.boolean('Status')) 144 #TODO some more parameter to add here147 #TODO some more parameters to add here 145 148 # Dimension parameters Time, Elevation, etc. are handled separately 146 def GetCoverage(self, file , version, format, identifier, boundingbox, timesequence, store=False, status=False):149 def GetCoverage(self, fileoruri, version, format, identifier, boundingbox, timesequence, store=False, status=False): 147 150 try: 148 151 # Retrieve dataset and selected feature 149 152 150 dataset = get_csml_doc(file)153 dataset = csmlCache[fileoruri] 151 154 feature = dataset.getFeature(identifier) 152 155 if feature is None: 153 156 raise OWS_E.InvalidParameterValue('Coverage not found', 'identifier') 154 157 158 155 159 #set bounding box TODO 156 160 sel = dict(latitude=(boundingbox[1], boundingbox[3]), longitude=(boundingbox[0], boundingbox[2])) … … 159 163 # Extract via CSML.subsetToGridSeries() 160 164 if store: 161 filename = extractToNetCDF(feature, sel, publish=True) 165 #need to farm off to WPS 166 #but for now... 167 filename = extractToNetCDF(feature, sel, publish = True) 162 168 else: 163 169 filename = extractToNetCDF(feature, sel) 164 165 #use the randomly allocated filename as a basis for an identifier 170 171 #use the randomly allocated filename as a basis for an identifier 166 172 f=os.path.basename(filename) 167 173 c.fileID=os.path.splitext(f)[0] -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/csml_util.py
r2682 r2689 50 50 securityTokens=securityTokens) 51 51 d=csml.parser.Dataset() 52 d.parseElemTree(x.tree) 52 if type(x) is str: 53 #then its an access denied message or similar: 54 return x 55 d.parseElemTree(x.tree) 53 56 return d 54 57 … … 83 86 publish flag is used to indicate that the netcdf file should be made available to the webserver (for asynchronous delivery) 84 87 """ 88 85 89 86 90 if publish: … … 90 94 else: 91 95 extract_dir = request.environ['paste.config']['app_conf']['tmp_dir'] 96 92 97 93 98 # Subset the feature -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/validators.py
r2650 r2689 39 39 40 40 return bbox_t 41 42 def bbox_2or3d(bbox): 43 """ 44 Checks it's a 2D or 3D BBOX and parse it into a tuple of floats. 45 46 """ 47 48 try: 49 bbox_t = [float(x) for x in bbox.split(',')] 50 except ValueError: 51 raise InvalidParameterValue("Incorrect BBOX specification %s" % bbox, 'bbox') 52 53 if len(bbox_t) not in [4,6]: 54 raise InvalidParameterValue("Incorrect BBOX specification %s" % bbox, 'bbox') 55 56 return bbox_t 57 41 58 42 59
Note: See TracChangeset
for help on using the changeset viewer.