private String getNameFromTheme( final Theme theme ) { if ( theme.getLayerMetadata().getName() != null ) { return theme.getLayerMetadata().getName(); } return null; }
private String getNameFromTheme( final Theme theme ) { if ( theme.getLayerMetadata().getName() != null ) { return theme.getLayerMetadata().getName(); } return null; }
private Style findLegendStyle( LayerRef layer, StyleRef styleRef ) { Style style; style = service.themeMap.get( layer.getName() ).getLayerMetadata().getLegendStyles().get( styleRef.getName() ); if ( style == null ) { style = service.themeMap.get( layer.getName() ).getLayerMetadata().getStyles().get( styleRef.getName() ); } return style; }
private void exportTheme( Theme t ) throws XMLStreamException { writer.writeStartElement( WMTSNS, "Theme" ); exportMetadata( t.getLayerMetadata(), false, null, null ); for ( Theme t2 : t.getThemes() ) { exportTheme( t2 ); } exportLayers( t.getLayers() ); writer.writeEndElement(); }
Double min = POSITIVE_INFINITY; Double max = NEGATIVE_INFINITY; if ( theme.getLayerMetadata() != null && theme.getLayerMetadata().getScaleDenominators() != null ) { final DoublePair themeScales = theme.getLayerMetadata().getScaleDenominators(); if ( !themeScales.first.isInfinite() ) { min = themeScales.first;
private String getFirstMetadataSetId( final Theme theme ) { if ( theme.getLayerMetadata().getMetadataId() != null ) { return theme.getLayerMetadata().getMetadataId(); } for ( final Layer layer : getAllLayers( theme ) ) { if ( layer.getMetadata().getMetadataId() != null ) { return layer.getMetadata().getMetadataId(); } } return null; }
public static void aggregateSpatialMetadata( Theme theme ) { // TODO price question is, bottom up or top down inheritance? Possibly a combined approach is desirable (top // down inheritance for configured theme values, bottom up for envelopes from layers or so) SpatialMetadata curSmd = theme.getLayerMetadata().getSpatialMetadata(); Envelope env = curSmd.getEnvelope(); List<ICRS> crs = new ArrayList<ICRS>(); if ( curSmd.getCoordinateSystems() != null ) { crs.addAll( curSmd.getCoordinateSystems() ); } for ( Theme t : theme.getThemes() ) { env = aggregateFromTheme( t, env, crs ); } for ( Layer l : theme.getLayers() ) { env = aggregateFromLayer( l, env, crs ); } theme.getLayerMetadata().setSpatialMetadata( new SpatialMetadata( env, crs ) ); }
} else { themes.add( thm ); themeMap.put( thm.getLayerMetadata().getName(), thm ); themeMap.put( theme.getLayerMetadata().getName(), theme );
private static Envelope aggregateFromTheme( Theme t, Envelope env, List<ICRS> crs ) { aggregateSpatialMetadata( t ); SpatialMetadata smd = t.getLayerMetadata().getSpatialMetadata(); if ( smd.getEnvelope() != null ) { if ( env == null ) { env = smd.getEnvelope(); } else { env = env.merge( smd.getEnvelope() ); } } if ( smd.getCoordinateSystems() != null ) { addAllUncontained( crs, smd.getCoordinateSystems() ); } return env; }
/** * Returns the combined layer metadata for the given theme/sublayers. * * @see LayerMetadata#merge(LayerMetadata) * * @param theme * must not be <code>null</code> * @return combined layer metadata, never <code>null</code> */ LayerMetadata merge( final Theme theme ) { final LayerMetadata themeMetadata = theme.getLayerMetadata(); LayerMetadata layerMetadata = new LayerMetadata( null, null, null ); int queryable = 0; boolean opaque = false; int cascaded = 0; for ( final Layer l : Themes.getAllLayers( theme ) ) { queryable |= analyseQueryable( l.getMetadata() ); if ( checkIfOpaque( l.getMetadata() ) ) opaque = true; if ( checkIfLargerCascadedValue( cascaded, l.getMetadata() ) ) cascaded = l.getMetadata().getCascaded(); layerMetadata.merge( l.getMetadata() ); } themeMetadata.merge( layerMetadata ); adjustMapOptions( themeMetadata, queryable, opaque, cascaded ); return themeMetadata; }