WrappedSampleDimension( String name, InternationalString configuredDescription, NumberRange<? extends Number> configuredRange, Unit<?> configuredUnit, double[] configuredNoDataValues, Category[] customCategories, GridSampleDimension sampleDim) { super(configuredDescription.toString(), customCategories, configuredUnit); this.configuredDescription = configuredDescription; this.configuredRange = configuredRange; this.configuredUnit = configuredUnit; this.configuredNoDataValues = configuredNoDataValues; this.customCategories = Arrays.asList(customCategories); this.sampleDim = sampleDim; }
/** * Clones the given grid range if necessary. This is mostly a protection for {@link GridRange2D} * which is mutable, at the opposite of {@link GeneralGridRange} which is immutable. We test for * the {@link GridRange2D} super-class which defines a {@code clone()} method, instead of {@link * GridRange2D} itself, for gaining some generality. */ private static GridEnvelope clone(GridEnvelope gridRange) { if (gridRange instanceof Cloneable) { gridRange = (GridEnvelope) ((Cloneable) gridRange).clone(); } return gridRange; }
/** Returns a string representation for the specified locale. */ public String toString(final Locale locale) { final StringBuilder buffer = new StringBuilder(); for (final LocalName name : parsedNames) { if (buffer.length() != 0) { buffer.append(separator); } buffer.append(name.toInternationalString().toString(locale)); } return buffer.toString(); }
public void complete() { delegate.progress(start + amount); progress = 100.0f; }
/** * Gets the string representation of this object. This just calls {@link #name()}. * * @return the string representation. */ @Override public String toString() { return name(); }
/** * Add a new {@code SimpleEnumerationType} to the given list using the given {@code name} and * {@code description}. The icon will be set to the Null Icon. * * @param values the list of values to add to. * @param name the short name for the enum. * @param description the description for the enum. */ protected SimpleEnumerationType(Collection<E> values, String name, String description) { super(name, values); this.description = description; this.icon = getNullIcon(); }
/** * Create a sub progress monitor, used to delegate work to a separate process. * * @param progress parent progress to notify as we get work done * @param amount amount of progress represented */ public SubProgressListener(org.opengis.util.ProgressListener progress, float amount) { this(progress, progress.getProgress(), amount); }
public void dispose() { delegate.dispose(); delegate = null; }
public static LanguageStringType languageString(InternationalString value) { if (value != null) { return languageString(value.toString(Locale.getDefault())); } else { return null; } }
public static GridCoverage2D wrapCoverage( GridCoverage2D coverage, GridCoverage2D sourceCoverage, GridSampleDimension[] wrappedDimensions, Map properties, boolean forceWrapping) { if (coverage instanceof GridCoverageWrapper || forceWrapping) { return new GridCoverageWrapper( coverage.getName().toString(), coverage, wrappedDimensions == null ? coverage.getSampleDimensions() : wrappedDimensions, properties == null ? sourceCoverage.getProperties() : properties); } return coverage; }
private void assertBandNames(GridCoverage coverage, String... bandNames) { assertEquals(bandNames.length, coverage.getNumSampleDimensions()); for (int i = 0; i < bandNames.length; i++) { String expectedName = bandNames[i]; String actualName = coverage.getSampleDimension(i).getDescription().toString(); assertEquals(expectedName, actualName); } }
CoverageDimensionInfo dim = catalog.getFactory().createCoverageDimension(); GridSampleDimension sd = sampleDimensions[i]; String name = sd.getDescription().toString(Locale.getDefault()); dim.setName(name); && cat.getName().toString(Locale.ENGLISH).equalsIgnoreCase("no data")) { double min = cat.getRange().getMinimum(); double max = cat.getRange().getMaximum();
InternationalString configuredDescription = (sampleDimDescription == null || !sampleDimDescription.toString().equalsIgnoreCase(name)) ? new SimpleInternationalString(name) : sampleDimDescription;
assertEquals( "A orange generic style", style.getDescription().getTitle().toString()); assertEquals(1, style.featureTypeStyles().size()); FeatureTypeStyle fts = style.featureTypeStyles().get(0); assertEquals( "raster", fts.rules().get(0).getDescription().getTitle().toString()); assertEquals( "orange polygon", fts.rules().get(1).getDescription().getTitle().toString()); assertEquals( "orange line", fts.rules().get(2).getDescription().getTitle().toString()); assertEquals( "orange point", fts.rules().get(3).getDescription().getTitle().toString());
@Override public Void answer() throws Throwable { Object[] args = getCurrentArguments(); InputStream is = (InputStream) args[1]; byte[] input = IOUtils.toByteArray(is); SLDParser parser = new SLDParser(CommonFactoryFinder.getStyleFactory()); parser.setInput(new ByteArrayInputStream(input)); StyledLayerDescriptor sld = parser.parseSLD(); NamedLayer nl = (NamedLayer) sld.getStyledLayers()[0]; assertEquals("foo", nl.getName()); Style style = nl.getStyles()[0]; assertEquals( "A raster style", style.getDescription().getTitle().toString()); assertEquals(1, style.featureTypeStyles().size()); FeatureTypeStyle fts = style.featureTypeStyles().get(0); assertEquals(1, fts.rules().size()); assertThat( fts.rules().get(0).symbolizers().get(0), instanceOf(RasterSymbolizer.class)); // make sure it's valid SLDValidator validator = new SLDValidator(); List errors = validator.validateSLD(new ByteArrayInputStream(input)); assertEquals(0, errors.size()); return null; } });
assertEquals(newMaximum, wrappedRange.getMaximum(), DELTA); assertEquals(wrappedName, wrappedDim.getDescription().toString());
for (int i = 0; i < sd.length; i++) { writer.write("<CoverageDimension>\n"); writer.write("<name>" + sd[i].getDescription().toString() + "</name>\n"); writer.write("<interval>\n"); writer.write("<min>" + sd[i].getMinimumValue() + "</min>\n"); for (Iterator<Category> it = sd[i].getCategories().iterator(); it.hasNext(); ) { Category cat = (Category) it.next(); if ((cat != null) && cat.getName().toString().equalsIgnoreCase("no data")) { double min = cat.getRange().getMinimum(); double max = cat.getRange().getMaximum();
assertEquals(1000, wrappedDim.getMaximumValue(), DELTA); assertEquals(wrappedName, wrappedDim.getDescription().toString());