deleteAll();
final String wsName = "geosolutions";
final String coverageStoreName = "resttestImageMosaic";
final GSImageMosaicEncoder coverageEncoder = new GSImageMosaicEncoder();
/*
* unused in mosaic creation
* this is only useful if you want to modify an existing coverage:
* publisher.configureCoverage(ce, wsname, csname);
* or create a new one from an existing store:
* publisher.createCoverage(ce, wsname, csname);
*/
// coverageEncoder.setName("time_geotiff");
coverageEncoder.setAllowMultithreading(true);
coverageEncoder.setBackgroundValues("");
coverageEncoder.setFilter("");
coverageEncoder.setInputTransparentColor("");
coverageEncoder.setLatLonBoundingBox(-180, -90, 180, 90, "EPSG:4326");
coverageEncoder.setMaxAllowedTiles(6000);
coverageEncoder.setNativeBoundingBox(-180, -90, 180, 90, "EPSG:4326");
coverageEncoder.setOutputTransparentColor("");
coverageEncoder.setProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED);
coverageEncoder.setSRS("EPSG:4326");
coverageEncoder.setSUGGESTED_TILE_SIZE("256,256");
coverageEncoder.setUSE_JAI_IMAGEREAD(true);
GSVersionDecoder v=reader.getGeoserverVersion();
if (v.compareTo(GSVersionDecoder.VERSION.v24)>=0){
GSCoverageDimensionEncoder gsCoverageDimensionEncoder = new GSCoverageDimensionEncoder(
"GRAY_INDEX", "GridSampleDimension[-Infinity,Infinity]", "-inf", "inf",
"dobson unitsĀ³", "REAL_32BITS");
coverageEncoder.addCoverageDimensionInfo(gsCoverageDimensionEncoder);
}
// activate time
final GSDimensionInfoEncoder time=new GSDimensionInfoEncoder(true);
time.setPresentation(Presentation.LIST);
// set time metadata
coverageEncoder.setMetadata("time", time);
// not active elevation
coverageEncoder.setMetadata("elevation", new GSDimensionInfoEncoder());
assertTrue(publisher.createWorkspace(wsName));
LOGGER.info(coverageEncoder.toString());
final String styleName = "raster";
File sldFile;
try {
sldFile = new ClassPathResource("testdata/raster.sld").getFile();