Changeset 2930 for TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wcs1_0_0.py
- Timestamp:
- 05/10/07 14:45:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wcs1_0_0.py
r2925 r2930 34 34 from ows_server.lib.ndgInterface import interface 35 35 from ows_server.models.wcs_CoverageDescription import CoverageDescription 36 36 import paste 37 37 38 38 import logging … … 190 190 #If not a csml datset is some message from exist such as 'access denied' 191 191 return Response(c.dataset) 192 return self._renderCapabilities('wcs1_0_ capabilities')192 return self._renderCapabilities('wcs1_0_0_Capabilities') 193 193 except Exception, e: 194 194 if isinstance(e, OWS_E.OwsError): … … 220 220 self.features[ident]=feature 221 221 c.covDescs=self._buildCoverageDescriptions() 222 r=render_response('wcs /wcs_DescribeCoverageResponse', format='xml')222 r=render_response('wcs1_0_0_DescribeCoverageResponse', format='xml') 223 223 r.headers['content-type'] = 'text/xml' 224 224 return r … … 236 236 @parameter('Identifier', required=True) 237 237 @parameter('BoundingBox', required=True, validator=V.bbox_2or3d) 238 @parameter('Time Sequence',required=True, validator=V.iso8601_time)238 @parameter('Time',required=True, validator=V.iso8601_time) 239 239 @parameter('Format', possibleValues=['application/netcdf'], required=True) 240 240 @parameter('Store', validator = V.boolean('Store')) … … 242 242 #TODO some more parameters to add here 243 243 # Dimension parameters Time, Elevation, etc. are handled separately 244 def GetCoverage(self, uri, version, format, identifier, boundingbox, time sequence, store=False, status=False):244 def GetCoverage(self, uri, version, format, identifier, boundingbox, time, store=False, status=False): 245 245 # Retrieve dataset and selected feature 246 246 try: … … 261 261 t=feature.getTimeAxis() 262 262 print '%s %s %s'%(lon,lat,t) 263 if None in [lon, lat, t ime]:263 if None in [lon, lat, t]: 264 264 #TODO need to return a suitable wcs error. 265 265 print 'warning, could not get correct axis info' … … 269 269 sel[lat]=(boundingbox[1], boundingbox[3]) 270 270 sel[lon]=(boundingbox[0], boundingbox[2]) 271 if type(time sequence) is unicode:272 sel[t]=str(time sequence)273 else: 274 sel[t]=time sequence271 if type(time) is unicode: 272 sel[t]=str(time) 273 else: 274 sel[t]=time 275 275 276 276 #z is the 4th axis (eg height or pressure). … … 289 289 290 290 # Extract via CSML.subsetToGridSeries() 291 292 print 'SEL %s'%sel293 291 if store: 294 292 #need to farm off to WPS … … 335 333 return r 336 334 else: 337 #STORE = FALSE, STATUS therefore irrelevant, return Multipart Mime. 338 netcdfFile=open(filename, 'r') 339 c.hyperlink="cid:coverage.nc" 340 xmlfile=render_response('wcs_getCoverageResponse', format='xml') 341 xmlfile.headers['content-type'] = 'text/xml' 342 multipart=self._createMultipartMime(xmlfile, netcdfFile) 343 msg=multipart 344 try: 345 #0.9.6 346 pylons.response.headers['Content-Type']='multipart' 347 return pylons.response(content=msg) 348 except: 349 #0.9.5 350 return Response(content=msg, mimetype='multipart') 335 #STORE = FALSE, STATUS therefore irrelevant, return file 336 fileToReturn=open(filename, 'r') 337 if os.path.splitext(filename)[1]=='.nc': 338 mType='application/cf-netcdf' 339 else: 340 mType='application/unknown' 341 #Differnce in how Content-Types are handled between pylons 0.9.5 and 0.9.6 342 try: 343 #0.9.6 344 pylons.response.headers['Content-Type']=mType 345 pylons.response.headers['Content-Disposition'] = paste.httpheaders.CONTENT_DISPOSITION(attachment=True, filename=f) 346 return pylons.response(content=fileToReturn) 347 except: 348 #0.9.5 349 r=Response(content=fileToReturn, mimetype=mType) 350 r.headers['Content-Disposition'] = paste.httpheaders.CONTENT_DISPOSITION(attachment=True, filename=f) 351 return r 351 352 except Exception, e: 352 353 if isinstance(e, OWS_E.OwsError):
Note: See TracChangeset
for help on using the changeset viewer.