/** * @param symbolizer * @param label * @param name * @param xmlText */ public Style( Symbolizer<?> symbolizer, Continuation<StringBuffer> label, String name, String xmlText ) { InsertContinuation<LinkedList<Symbolizer<?>>, Symbolizer<?>> contn; contn = new InsertContinuation<LinkedList<Symbolizer<?>>, Symbolizer<?>>( symbolizer ); rules.add( new Pair<Continuation<LinkedList<Symbolizer<?>>>, DoublePair>( contn, new DoublePair( NEGATIVE_INFINITY, POSITIVE_INFINITY ) ) ); if ( label != null ) { labels.put( (Symbolizer) symbolizer, label ); } if ( xmlText != null ) { labelXMLTexts.put( (Symbolizer) symbolizer, xmlText ); } this.name = name; }
DoublePair scales = new DoublePair( minScale, maxScale ); result.add( new Pair<Continuation<LinkedList<Symbolizer<?>>>, DoublePair>( contn, scales ) );
public static Pair<Envelope, DoublePair> getWorldToScreenTransform( AffineTransform worldToScreen, Envelope bbox, int width, int height ) { // we have to flip horizontally, so invert y-axis and move y-axis with screen height worldToScreen.scale( 1, -1 ); worldToScreen.translate( 0, -height ); // calculate scalex, scaley and swap axis if necessary final double scalex, scaley; final ICRS crs = bbox.getCoordinateSystem(); if ( isXyOrdered( crs ) ) { scalex = width / bbox.getSpan0(); scaley = height / bbox.getSpan1(); } else { worldToScreen.scale( -1, 1 ); worldToScreen.rotate( Math.PI / 2 ); scalex = height / bbox.getSpan0(); scaley = width / bbox.getSpan1(); } worldToScreen.scale( scalex, scaley ); worldToScreen.translate( -bbox.getMin().get0(), -bbox.getMin().get1() ); return new Pair<Envelope, DoublePair>( bbox, new DoublePair( scalex, scaley ) ); }
DoublePair scale = new DoublePair( NEGATIVE_INFINITY, POSITIVE_INFINITY ); Double min = (Double) rs.getObject( "minscale" ); if ( min != null ) {
return new DoublePair( min, max );
ScaleDenominatorsType sd = cfg.getScaleDenominators(); if ( sd != null ) { DoublePair p = new DoublePair( sd.getMin(), sd.getMax() ); md.setScaleDenominators( p );
md.setScaleDenominators( new DoublePair( denoms.getMin(), denoms.getMax() ) );
static LayerMetadata buildLayerMetadata( CoverageLayerType lay, Coverage cov ) { SpatialMetadata smd = fromJaxb( lay.getEnvelope(), lay.getCRS() ); Description desc = fromJaxb( lay.getTitle(), lay.getAbstract(), lay.getKeywords() ); LayerMetadata md = new LayerMetadata( lay.getName(), desc, smd ); md.setDimensions( parseDimensions( md.getName(), lay.getDimension() ) ); md.setMapOptions( ConfigUtils.parseLayerOptions( lay.getLayerOptions() ) ); md.setMetadataId( lay.getMetadataSetId() ); md.getFeatureTypes().add( buildFeatureType() ); if ( smd.getEnvelope() == null ) { smd.setEnvelope( cov.getEnvelope() ); } if ( smd.getCoordinateSystems() == null || smd.getCoordinateSystems().isEmpty() ) { List<ICRS> crs = new ArrayList<ICRS>(); crs.add( smd.getEnvelope().getCoordinateSystem() ); smd.setCoordinateSystems( crs ); } ScaleDenominatorsType denoms = lay.getScaleDenominators(); if ( denoms != null ) { md.setScaleDenominators( new DoublePair( denoms.getMin(), denoms.getMax() ) ); } return md; }
md.setScaleDenominators( new DoublePair( denoms.getMin(), denoms.getMax() ) );