Opened 11 years ago

Closed 10 years ago

#626 closed defect (fixed)

WCS incomplete supported formats listing in service capabilities

Reported by: Piero Campalani Owned by: gxinghua
Priority: major Milestone: 9.0.x
Component: petascope Version: development
Keywords: supported formats wcs Cc:
Complexity: Easy

Description

A partial list of supported output formats is provided by Petascope:

<wcs:ServiceMetadata xmlns="http://www.opengis.net/ows/2.0">
  <wcs:formatSupported>image/jp2</wcs:formatSupported>
  <wcs:formatSupported>image/tiff</wcs:formatSupported>
  <wcs:formatSupported>application/gml+xml</wcs:formatSupported>
</wcs:ServiceMetadata>

whereas:

$ grep MIME ./petascope/wcs2/extensions/ -r
./petascope/wcs2/extensions/MultipartFormatExtension.java:    public static final String[] SET_VALUES = new String[] { MIME_TIFF, MIME_JP2 };
./petascope/wcs2/extensions/FormatExtension.java:    String MIME_TEXT = "text/plain";
./petascope/wcs2/extensions/FormatExtension.java:    String MIME_MULTIPART = "multipart/related";
./petascope/wcs2/extensions/FormatExtension.java:    String MIME_GML = "application/gml+xml";
./petascope/wcs2/extensions/FormatExtension.java:    String MIME_XML = "text/xml";
./petascope/wcs2/extensions/FormatExtension.java:    String MIME_TIFF = "image/tiff";
./petascope/wcs2/extensions/FormatExtension.java:    String MIME_JP2 = "image/jp2";
./petascope/wcs2/extensions/FormatExtension.java:    String MIME_NETCDF = "application/netcdf";
./java/petascope/wcs2/extensions/NetcdfFormatExtension.java:        return MIME_NETCDF;
./petascope/wcs2/extensions/JPEG2000FormatExtension.java:        return MIME_JP2;
./petascope/wcs2/extensions/GeotiffFormatExtension.java:        return MIME_TIFF;
./petascope/wcs2/extensions/GmlFormatExtension.java:        return MIME_GML;

The key code is in the class GetCapabilitiesHandler:

254         //
255         // ServiceMetadata
256         //
257         Element serviceMetadata = Templates.getXmlTemplate(Templates.SERVICE_METADATA);
258         if (serviceMetadata != null) {
259             // add supported formats
260             //: [Req6 /req/core/serviceMetadata-structure]
261             //: [Req9 /req/core/formats-supported]
262             Set<String> mimeTypes = new HashSet<String>();
263             for (Extension extension : ExtensionsRegistry.getExtensions()) {
264                 if (extension instanceof FormatExtension) {
265                     mimeTypes.add(((FormatExtension) extension).getMimeType());
266                 }
267             }
268             for (String mimeType : mimeTypes) {
269                 Element formatSupported = new Element(PREFIX_WCS + ":" + LABEL_FORMAT_SUPPORTED, NAMESPACE_WCS);                                         
270                 formatSupported.appendChild(mimeType);
271                 // Insert it on top, in case the template already contains some other fixed content
272                 serviceMetadata.insertChild(formatSupported, 0);
273             }

Change History (5)

comment:1 by gxinghua, 10 years ago

Owner: changed from Piero Campalani to gxinghua
Status: newassigned

comment:2 by Dimitar Misev, 10 years ago

Has this been fixed?

comment:3 by gxinghua, 10 years ago

fixed in changeset:b8db2ed.
register NetCDF format extension.

comment:4 by gxinghua, 10 years ago

Cc: Piero Campalani added

comment:5 by Piero Campalani, 10 years ago

Cc: Piero Campalani removed
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.