/** * Create an instance of {@link SupportOptions } * */ public SupportOptions createSupportOptions() { return new SupportOptions(); }
private CoverageOptions buildOptions( String nativeFormat, SupportOptions options ) { List<String> formats, crs; List<InterpolationType> interpolation; if ( options == null ) { formats = new LinkedList<String>(); interpolation = new LinkedList<InterpolationType>(); crs = new LinkedList<String>(); } else { formats = options.getOutputFormat(); if ( formats.isEmpty() ) { formats.addAll( defaultOptions.getOutputFormat() ); } interpolation = mapInterpolation( options.getInterpolation() ); if ( interpolation.isEmpty() ) { interpolation.addAll( mapInterpolation( defaultOptions.getInterpolation() ) ); } crs = options.getSupportedCRS(); if ( crs.isEmpty() ) { crs.addAll( defaultOptions.getSupportedCRS() ); } } if ( options == null || options.isExtend() ) { formats.addAll( defaultOptions.getOutputFormat() ); interpolation.addAll( mapInterpolation( defaultOptions.getInterpolation() ) ); crs.addAll( defaultOptions.getSupportedCRS() ); } return new CoverageOptions( nativeFormat, formats, crs, interpolation ); }
/** * @return a new WCService */ public WCService buildService() { wcsService = new WCService(); ServiceConfiguration wcsConf = ServiceConfigurationXMLAdapter.parse( workspace, metadata ); RasterDataContainerFactory.setDefaultLoadingPolicy( LoadingPolicy.CACHED ); defaultOptions = wcsConf.getSupportOptions(); if ( defaultOptions == null ) { defaultOptions = new SupportOptions(); } // if the list of outputformats is not defined by the config, use all available formats. List<String> defaultFormats = defaultOptions.getOutputFormat(); if ( defaultFormats.isEmpty() ) { defaultFormats.addAll( RasterFactory.getAllSupportedWritingFormats() ); Collections.sort( defaultFormats ); } for ( Coverage coverage : wcsConf.getCoverage() ) { try { wcsService.addCoverage( extractCoverage( coverage ) ); } catch ( ServiceInitException ex ) { LOG.error( "unable to load coverage: {}", ex.getMessage(), ex ); } } return wcsService; }