Package org.geoserver.catalog

Examples of org.geoserver.catalog.CoverageInfo


            FeatureTypeInfo featureTypeInfo = wms.getFeatureTypeInfo(name);

            if(featureTypeInfo == null){
                //It may be a wrapped coverage
                CoverageInfo cInfo = wms.getCoverageInfo(name);
                if(cInfo != null){
                    templateLoader.setCoverage(cInfo);
                }else{
                    throw new IllegalArgumentException("Can't find neither a FeatureType nor " +
                            "a CoverageInfo named " + name);
View Full Code Here


     
      assertNotNull(multipleRulesStyle);
     
 
      GetLegendGraphicRequest req = new GetLegendGraphicRequest(getWMS());
      CoverageInfo cInfo = getCatalog().getCoverageByName("world");
      assertNotNull(cInfo);
     
        GridCoverage coverage = cInfo.getGridCoverage(null, null);
        FeatureCollection<SimpleFeatureType, SimpleFeature> feature;
        feature = FeatureUtilities.wrapGridCoverage((GridCoverage2D) coverage);
        req.setLayer(feature.getSchema());
      req.setStyle(multipleRulesStyle);
      req.setLegendOptions(new HashMap());
View Full Code Here

    @Override
    protected String handleObjectPost(Object object) throws Exception {
        String workspace = getAttribute( "workspace");
        String coveragestore = getAttribute( "coveragestore");

        CoverageInfo coverage = (CoverageInfo) object;
        if ( coverage.getStore() == null ) {
            //get from requests
            CoverageStoreInfo ds = catalog.getCoverageStoreByName( workspace, coveragestore );
            coverage.setStore( ds );
        }
       
        NamespaceInfo ns = coverage.getNamespace();
        if ( ns != null && !ns.getPrefix().equals( workspace ) ) {
            //TODO: change this once the two can be different and we untie namespace
            // from workspace
            LOGGER.warning( "Namespace: " + ns.getPrefix() + " does not match workspace: " + workspace + ", overriding." );
            ns = null;
        }
       
        if ( ns == null){
            //infer from workspace
            ns = catalog.getNamespaceByPrefix( workspace );
            coverage.setNamespace( ns );
        }
       
        coverage.setEnabled(true);
        catalog.add( coverage );
       
        //create a layer for the coverage
        catalog.add(new CatalogBuilder(catalog).buildLayer(coverage));
       
        LOGGER.info( "POST coverage " + coveragestore + "," + coverage.getName() );
        return coverage.getName();
    }
View Full Code Here

        return getAttribute("coverage") != null;
    }
   
    @Override
    protected void handleObjectPut(Object object) throws Exception {
        CoverageInfo c = (CoverageInfo) object;
       
        String workspace = getAttribute("workspace");
        String coveragestore = getAttribute("coveragestore");
        String coverage = getAttribute("coverage");
       
        CoverageStoreInfo cs = catalog.getCoverageStoreByName(workspace, coveragestore);
        CoverageInfo original = catalog.getCoverageByCoverageStore( cs,  coverage );
        new CatalogBuilder(catalog).updateCoverage(original,c);
        catalog.save( original );
       
        LOGGER.info( "PUT coverage " + coveragestore + "," + coverage );
    }
View Full Code Here

        String workspace = getAttribute("workspace");
        String coveragestore = getAttribute("coveragestore");
        String coverage = getAttribute("coverage");
       
        CoverageStoreInfo ds = catalog.getCoverageStoreByName(workspace, coveragestore);
        CoverageInfo c = catalog.getCoverageByCoverageStore( ds,  coverage );
        catalog.remove( c );

        LOGGER.info( "DELETE coverage " + coveragestore + "," + coverage );
    }
View Full Code Here

                (AbstractGridCoverage2DReader) ((AbstractGridFormat) coverageFormat).getReader(uploadedFile.toURL());
            if ( reader == null ) {
                throw new RestletException( "Could not aquire reader for coverage.", Status.SERVER_ERROR_INTERNAL );
            }
           
            CoverageInfo cinfo = builder.buildCoverage( reader );
           
            //check if the name of the coverage was specified
            String coverageName = form.getFirstValue("coverageName");
            if ( coverageName != null ) {
                cinfo.setName( coverageName );
            }
           
            if ( !add ) {
                //update the existing
                CoverageInfo existing = catalog.getCoverageByCoverageStore(info,
                    coverageName != null ? coverageName : coverage );
                if ( existing == null ) {
                    //grab the first if there is only one
                    List<CoverageInfo> coverages = catalog.getCoveragesByCoverageStore( info);
                    if ( coverages.size() == 1 ) {
View Full Code Here

    private String newInterpolationMethod;

    public WCSLayerConfig(String id, IModel model){
        super(id, model);

        final CoverageInfo coverage = (CoverageInfo) getLayerInfo().getResource();
        add(new ListMultipleChoice("requestSRS",
                    new PropertyModel(this, "selectedRequestSRSs"),
                    coverage.getRequestSRS())
        );

        add(new TextField("newRequestSRS", new PropertyModel(this, "newRequestSRS")));

        add(new Button("deleteSelectedRequestSRSs"){
            public void onSubmit(){
                coverage.getRequestSRS().removeAll(selectedRequestSRSs);
                selectedRequestSRSs.clear();
            }
        });

        add(new Button("addNewRequestSRS"){
            public void onSubmit(){
                coverage.getRequestSRS().add(newRequestSRS);
                newRequestSRS = "";
            }
        });

        add (new ListMultipleChoice("responseSRS",
                    new PropertyModel(this, "selectedResponseSRSs"),
                    coverage.getResponseSRS())
        );

        add(new TextField("newResponseSRS", new PropertyModel(this, "newResponseSRS")));

        add(new Button("deleteSelectedResponseSRSs"){
            public void onSubmit(){
                coverage.getResponseSRS().removeAll(selectedResponseSRSs);
                selectedResponseSRSs.clear();
            }
        });

        add(new Button("addNewResponseSRS"){
            public void onSubmit(){
                coverage.getResponseSRS().add(newResponseSRS);
                newResponseSRS = "";
            }
        });

        add(new DropDownChoice("defaultInterpolationMethod", new PropertyModel(coverage, "defaultInterpolationMethod"),
View Full Code Here

                           
                            //load coverages
                            for ( File cd : list(sd,DirectoryFileFilter.INSTANCE) ) {
                                f = new File( cd, "coverage.xml" );
                                if( f.exists() ) {
                                    CoverageInfo c = null;
                                    try {
                                        c = depersist(xp,f,CoverageInfo.class);
                                        catalog.add( c );
                                       
                                        LOGGER.info( "Loaded coverage '" + cs.getName() +"'");
                                    }
                                    catch( Exception e ) {
                                        LOGGER.log( Level.WARNING, "Failed to load coverage '" + cd.getName() +"'", e);
                                        continue;
                                    }
                                   
                                    f = new File( cd, "layer.xml" );
                                    if ( f.exists() ) {
                                        try {
                                            LayerInfo l = depersist(xp, f, LayerInfo.class );
                                            catalog.add( l );
                                           
                                            LOGGER.info( "Loaded layer '" + l.getName() + "'" );
                                        }
                                        catch( Exception e ) {
                                            LOGGER.log( Level.WARNING, "Failed to load layer coverage '" + c.getName() +"'", e);
                                        }
                                    }
                                }
                                else {
                                    LOGGER.warning( "Ignoring coverage directory " + cd.getAbsolutePath() );
View Full Code Here

        NamespaceInfo ns = catalog.getFactory().createNamespace();
        ns.setPrefix( "bar" );
        ns.setURI( "http://bar" );
        catalog.add( ns );
       
        CoverageInfo ft = catalog.getFactory().createCoverage();
        ft.setName( "foo" );
        ft.setNamespace( ns );
        ft.setStore( catalog.getCoverageStoreByName( "acme", "foostore"));
        catalog.add( ft );
       
        assertTrue( d.exists() );
    }
View Full Code Here

    }
   
    public void testModifyCoverage() throws Exception {
        testAddCoverage();
       
        CoverageInfo ft = catalog.getCoverageByName( "bar", "foo" );
        ft.setTitle( "fooTitle" );
        catalog.save( ft );
       
        File f = new File( testData.getDataDirectoryRoot(),
            "workspaces/acme/foostore/foo/coverage.xml");
        Document dom = dom( f );
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.CoverageInfo

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.