private Theme buildAutoTheme( Map<String, LayerStore> stores ) { Description desc = new Description( null, Collections.singletonList( new LanguageString( "root", null ) ), null, null ); LayerMetadata md = new LayerMetadata( null, desc, new SpatialMetadata( null, Collections.<ICRS> emptyList() ) ); List<Theme> themes = new ArrayList<Theme>(); for ( Entry<String, LayerStore> e : stores.entrySet() ) { themes.add( buildAutoTheme( e.getKey(), e.getValue() ) ); } return new StandardTheme( md, themes, new ArrayList<Layer>(), metadata ); }
private Theme buildAutoTheme( String id, LayerStore store ) { Description desc = new Description( id, singletonList( new LanguageString( id, null ) ), null, null ); LayerMetadata md = new LayerMetadata( null, desc, new SpatialMetadata( null, Collections.<ICRS> emptyList() ) ); List<Theme> themes = new ArrayList<Theme>(); for ( Layer l : store.getAll() ) { themes.add( buildAutoTheme( l ) ); } return new StandardTheme( md, themes, new ArrayList<Layer>(), metadata ); }
static LayerMetadata buildMetadataForAutoMode( FeatureStore store, FeatureType ft, String name ) { List<ICRS> crs = new ArrayList<ICRS>(); Envelope envelope = null; try { envelope = store.getEnvelope( ft.getName() ); } catch ( Throwable e ) { LOG.debug( "Could not get envelope from feature store: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } if ( envelope != null ) { crs.add( envelope.getCoordinateSystem() ); } SpatialMetadata smd = new SpatialMetadata( envelope, crs ); Description desc = new Description( name, Collections.singletonList( new LanguageString( name, null ) ), null, null ); LayerMetadata md = new LayerMetadata( name, desc, smd ); md.getFeatureTypes().add( ft ); return md; }
return new Description( null, titles, abstracts, keywords );
public static Description fromJaxb( List<LanguageStringType> titles, List<LanguageStringType> abstracts, List<KeywordsType> keywords ) { Description desc = new Description( null, null, null, null ); if ( titles != null ) { desc.setTitles( map( titles, LANG_LANG_MAPPER ) ); } if ( abstracts != null ) { desc.setAbstracts( map( abstracts, LANG_LANG_MAPPER ) ); } if ( keywords != null ) { desc.setKeywords( map( keywords, KW_MAPPER ) ); } return desc; }
LayerStore createFromAutoLayers( AutoLayers cfg ) { String cid = cfg.getCoverageStoreId(); String sid = cfg.getStyleStoreId(); Coverage cov = workspace.getResource( CoverageProvider.class, cid ); StyleStore sstore = null; if ( sid != null ) { sstore = workspace.getResource( StyleStoreProvider.class, sid ); } SpatialMetadata smd = new SpatialMetadata( cov.getEnvelope(), Collections.singletonList( cov.getCoordinateSystem() ) ); Description desc = new Description( cid, Collections.singletonList( new LanguageString( cid, null ) ), null, null ); LayerMetadata md = new LayerMetadata( cid, desc, smd ); md.getFeatureTypes().add( buildFeatureType() ); if ( sstore != null ) { for ( Style s : sstore.getAll( cid ) ) { md.getStyles().put( s.getName(), s ); } } Layer l = new CoverageLayer( md, cov instanceof AbstractRaster ? (AbstractRaster) cov : null, cov instanceof MultiResolutionRaster ? (MultiResolutionRaster) cov : null ); return new SingleLayerStore( l, metadata ); }
Description desc = new Description( null, null, null, null ); desc.setTitles( singletonList( new LanguageString( title, null ) ) ); if ( abstract_ != null ) {