Opened 3 years ago

Closed 3 years ago

#626 closed defect (fixed)

WCS incomplete supported formats listing in service capabilities

Reported by: pcampalani 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 Changed 3 years ago by gxinghua

  • Owner changed from pcampalani to gxinghua
  • Status changed from new to assigned

comment:2 Changed 3 years ago by dmisev

Has this been fixed?

comment:3 Changed 3 years ago by gxinghua

fixed in changeset:b8db2ed.
register NetCDF format extension.

comment:4 Changed 3 years ago by gxinghua

  • Cc pcampalani added

comment:5 Changed 3 years ago by pcampalani

  • Cc pcampalani removed
  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.