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; }
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; }
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;
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); } }
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());
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();
@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; } });
/** * Same convenience method than {@link org.geotools.cs.AbstractCS#name} except that we get the * unlocalized name (usually in English locale), because the name is part of the elements * compared by the {@link #equals} method. */ static Map<String, Object> name(final int key) { final Map<String, Object> properties = new HashMap<String, Object>(4); final InternationalString name = Vocabulary.formatInternational(key); properties.put(NAME_KEY, name.toString(null)); // "null" required for unlocalized version. properties.put(ALIAS_KEY, name); return properties; }
@Override public Element encode(Object object, Document document, Element value) throws Exception { Position timePosition = (Position) object; if (timePosition == null) { value.appendChild( document.createElementNS( GML.NAMESPACE, org.geotools.gml3.GML.Null.getLocalPart())); } value.appendChild(document.createTextNode(timePosition.getDateTime().toString())); return null; }
/** 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(); }
/** * This constructor replace the constructor with further DateTime object which will be included * in the futur version of jdk (jdk7). example of datetime argument: format specified by the * ISO8601 yyyy-mm-DDTHH:MM:SSZ - example : 2003-02-13T12:28:00.000GMT-08:00. * * @param dateTime * @throws java.text.ParseException */ public DefaultPosition(final InternationalString datetime) throws ParseException { this.position = Utils.getDateFromString(datetime.toString()); }
@Deprecated public String getAbstract() { if (description == null || description.getAbstract() == null) { return null; } return description.getAbstract().toString(); }
assertEquals(newMaximum, wrappedRange.getMaximum(), DELTA); assertEquals(wrappedName, wrappedDim.getDescription().toString());
/** @see org.geotools.data.ResourceInfo#getTitle() */ public String getTitle() { InternationalString description = info.getFeatureType().getDescription(); return description == null ? info.getFeatureTypeName() : description.toString(); }
private void getMetaDataStandard(Metadata metadata, DefaultMetadata defaultMetaData){ ArrayList<Citation> citationList= (ArrayList<Citation>) defaultMetaData.getMetadataStandards(); for(Citation c:citationList){ if(c.getTitle()!=null) metadata.add("MetaDataStandardTitle ",c.getTitle().toString()); if(c.getEdition()!=null) metadata.add("MetaDataStandardEdition ",c.getEdition().toString()); } } }
assertEquals(1000, wrappedDim.getMaximumValue(), DELTA); assertEquals(wrappedName, wrappedDim.getDescription().toString());
/** Tests the vendor. */ @Test public void testVendor() { final Citation vendor = factory.getVendor(); assertNotNull(vendor); assertEquals("Geotools", vendor.getTitle().toString()); }
/** Tests the vendor name. */ public void testVendor() { CRSAuthorityFactory factory; Citation vendor; factory = new OrderedAxisAuthorityFactory("EPSG", null, null); vendor = factory.getVendor(); assertNotNull(vendor); assertEquals("Geotools", vendor.getTitle().toString(Locale.US)); assertFalse(Citations.identifierMatches(vendor, "EPSG")); }