Changeset 2653 for TI05-delivery/ows_framework
- Timestamp:
- 27/06/07 14:34:23 (12 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
r2650 r2653 43 43 44 44 # Create the container (outer) email message. 45 msg = MIMEMultipart() 45 msg = MIMEMultipart() 46 47 xmlfile =StringIO.StringIO(xml) 48 xmlfile.readline(), xmlfile.readline() #don't read in first 2 lines (the content type) as MIMEBase also provides it. 49 46 50 47 51 #add the XML part 48 submsg=MIMEText(StringIO.StringIO(xml).read(), _subtype='xml') 52 submsg=MIMEText(xmlfile.read(), _subtype='xml') 53 submsg.add_header('Content-ID', '<coverage.xml>') 49 54 msg.attach(submsg) 50 55 51 56 52 57 #add the NetCDF part 53 submsg= MIMEBase('application', ' netcdf')58 submsg= MIMEBase('application', 'CF-netcdf') #check in ogc docs 54 59 submsg.set_payload(netcdf.read()) 60 submsg.set_type('application/CF-netcdf; name="coverage.nc"') 61 submsg.add_header('Content-ID', '<coverage.nc>') 55 62 netcdf.close() 56 63 # Encode the payload using Base64 … … 78 85 def _loadFeatureSummary(self, feature): 79 86 dims = self._loadFeatureDimensions(feature) 87 #TODO - need to ensure proper values for Name. ID and Description are populated. 88 cvgTitle=[feature.description.CONTENT] 89 cvgDescription=feature.description.CONTENT 90 cvgAbstract=[feature.description.CONTENT] 91 bbox=c.dataset.getBoundingBox() #TODO, use the bounding box of the feature not the dataset. 80 92 return WcsDatasetSummary(identifier=feature.id, 81 titles=[feature.description.CONTENT], 82 boundingBoxes=[BoundingBox([-180,-90], [180,90], 83 crs='CRS:84')], 84 dimensions=dims, description=feature.description.CONTENT 93 titles=cvgTitle, 94 boundingBoxes=[BoundingBox([bbox[0],bbox[1]], [bbox[2],bbox[3]], 95 crs='CRS:84')], dimensions=dims, description=cvgDescription,abstracts=cvgAbstract 85 96 ) 86 97 … … 150 161 filename = extractToNetCDF(feature, sel) 151 162 163 #use the randomly allocated filename as a basis for an identifier 164 f=os.path.basename(filename) 165 c.fileID=os.path.splitext(f)[0] 166 152 167 #Depending on if the 'store' parameter is set, either return the netcdf file + coverage xml as a multipart mime or return a coverage document containing a link. 168 153 169 if store: 154 170 if status: … … 161 177 #STORE=true, STATUS = false: Return Coverage XML document with link to file. 162 178 #use the temp file name (minus extension) as an ID 163 f=os.path.basename(filename)164 c.fileID=os.path.splitext(f)[0]165 179 c.hyperlink = 'http://'+request.environ['HTTP_HOST']+'/'+os.path.basename(request.environ['paste.config']['app_conf']['publish_dir'])+'/'+os.path.basename(filename) 166 180 r=render_response('wcs_getCoverageResponse', format='xml') … … 170 184 #STORE = FALSE, STATUS therefore irrelevant, return Multipart Mime. 171 185 netcdfFile=open(filename, 'r') 186 c.hyperlink="cid:coverage.nc" 172 187 xmlfile=render_response('wcs_getCoverageResponse', format='xml') 173 188 xmlfile.headers['content-type'] = 'text/xml' -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ows/wcs_capabilities.kid
r2592 r2653 53 53 <Identifier py:if="ds.identifier is not None" py:content="ds.identifier"/> 54 54 <Description py:if="ds.description is not None" py:content="ds.description"/> 55 <ows:Title ></ows:Title>56 <ows:Abstract ></ows:Abstract>55 <ows:Title py:if="ds.titles is not None" py:content="ds.titles"/> 56 <ows:Abstract py:if="ds.abstracts is not None" py:content="ds.abstracts"/> 57 57 <ows:Metadata></ows:Metadata> 58 58 <ows:WGS84BoundingBox></ows:WGS84BoundingBox> -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wcs_getCoverageResponse.kid
r2649 r2653 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 < GetCoveragexmlns="http://www.opengis.net/wcs/1.1"2 <Coverages xmlns="http://www.opengis.net/wcs/1.1" 3 3 xmlns:py="http://purl.org/kid/ns#" 4 4 xmlns:ows="http://www.opengis.net/ows" 5 xmlns:xlink="http://www.w3.org/1999/xlink" 6 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 7 xsi:schemaLocation="http://www.opengis.net/wcs/1.1/ows ../owsCoverages.xsd http://www.opengis.net/ows ../../../ows/1.0.0/ows19115subset.xsd"> 5 xmlns:xlink="http://www.w3.org/1999/xlink" > 8 6 <Coverage> 9 7 <ows:Title>Coverage ${c.fileID}</ows:Title> 10 8 <ows:Abstract>Created from getCoverage request to NDG WCS</ows:Abstract> 11 9 <Identifier>${c.fileID}</Identifier> 12 <Reference>xlink:href "${c.hyperlink}" xlink:role="urn:ogc:def:role:WCS:1.1:metadata</Reference>10 <Reference>xlink:href="${c.hyperlink}" xlink:role="urn:ogc:def:role:WCS:1.1:metadata"</Reference> 13 11 </Coverage> 14 </ GetCoverage>12 </Coverages>
Note: See TracChangeset
for help on using the changeset viewer.