Package it.geosolutions.geoserver.rest.encoder.coverage

Examples of it.geosolutions.geoserver.rest.encoder.coverage.GSImageMosaicEncoder


        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();
View Full Code Here


     * @param coverageStoreName the coverage store name
     * @param csname the coverage name
     */
   
    private void fixDimensions(String wsName, String coverageStoreName, String csname) {
        final GSImageMosaicEncoder coverageEncoder = copyParameters(wsName, coverageStoreName,
                csname);
 
              
        // activate time dimension
        final GSDimensionInfoEncoder time=new GSDimensionInfoEncoder(true);
        time.setUnit("Seconds");
        time.setUnitSymbol("s");
        time.setPresentation(Presentation.CONTINUOUS_INTERVAL);
        coverageEncoder.setMetadataDimension("time", time);
       
        // activate run which is a custom dimension
        final GSDimensionInfoEncoder date=new GSDimensionInfoEncoder(true);
        date.setPresentation(Presentation.LIST);
        coverageEncoder.setMetadataDimension("date", date,true);
       
        final GSDimensionInfoEncoder depth=new GSDimensionInfoEncoder(true);
        depth.setPresentation(Presentation.LIST);
        depth.setUnit("Meters");
        depth.setUnitSymbol("m");
        coverageEncoder.setMetadataDimension("depth", depth,true);
       
        // persiste the changes
        boolean config=publisher.configureCoverage(coverageEncoder, wsName, csname);
        assertTrue(config);
      
View Full Code Here

        if (coverage==null)
            return null;
        final Map<String, String> params = coverage.getParametersList();    
       
        // prepare and fill the encoder
        final GSImageMosaicEncoder coverageEncoder = new GSImageMosaicEncoder();
        coverageEncoder.setName("mosaic");
       
        // set the current params, change here if you want to change the values
        for(Map.Entry<String, String> entry:params.entrySet()){
            if(entry.getKey().equals(GSImageMosaicEncoder.allowMultithreading)){
                coverageEncoder.setAllowMultithreading(Boolean.parseBoolean(entry.getValue()));
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.backgroundValues)){
                coverageEncoder.setBackgroundValues(entry.getValue());
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.filter)){
                coverageEncoder.setFilter(entry.getValue());
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.inputTransparentColor)){
                coverageEncoder.setInputTransparentColor(entry.getValue());
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.maxAllowedTiles)){
                coverageEncoder.setMaxAllowedTiles(Integer.parseInt(entry.getValue()));
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.MERGEBEHAVIOR)){
                coverageEncoder.setMergeBehavior(entry.getValue());
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.outputTransparentColor)){
                coverageEncoder.setOutputTransparentColor(entry.getValue());
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.SORTING)){
                coverageEncoder.setSORTING(entry.getValue());
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.SUGGESTED_TILE_SIZE)){
                coverageEncoder.setSUGGESTED_TILE_SIZE(entry.getValue());
                continue;
            }
           
            if(entry.getKey().equals(GSImageMosaicEncoder.USE_JAI_IMAGEREAD)){
                coverageEncoder.setUSE_JAI_IMAGEREAD(Boolean.parseBoolean(entry.getValue()));
                continue;
            }
           
        }
        return coverageEncoder;
View Full Code Here

TOP

Related Classes of it.geosolutions.geoserver.rest.encoder.coverage.GSImageMosaicEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.