if (aliases.contains(pd.getName().getCode())) { final ParameterValue pv = (ParameterValue) pd.createValue(); pv.setValue(value);
@Test public void testMaxTiles() { ParameterDescriptor<Integer> pdescriptor = ImageMosaicFormat.MAX_ALLOWED_TILES; ParameterValue<Integer> pvalue = pdescriptor.createValue(); String key = pdescriptor.getName().getCode(); Map values = Collections.singletonMap(key, "1"); Object value = CoverageUtils.getCvParamValue(key, pvalue, values); assertTrue(value instanceof Integer); assertEquals(Integer.valueOf(1), value); } }
String pdCode = pv.getDescriptor().getName().getCode(); if ("FILTER".equals(pdCode) || "Filter".equals(pdCode)) { replacedOriginalFilter = true;
@Test public void testGetOutputTransparentColor() { ParameterDescriptor<Color> pdescriptor = ImageMosaicFormat.OUTPUT_TRANSPARENT_COLOR; ParameterValue<Color> pvalue = pdescriptor.createValue(); String key = pdescriptor.getName().getCode(); Map values = Collections.singletonMap(key, "0xFFFFFF"); Object value = CoverageUtils.getCvParamValue(key, pvalue, values); assertTrue(value instanceof Color); assertEquals(Color.WHITE, value); }
final CoordinateSystem cs = crs.getCoordinateSystem(); for (int i = 0; i < cs.getDimension(); i++) { writer.write("<axisName>" + cs.getAxis(i).getName().getCode() + "</axisName>\n");
/** * Convenience method returning the name of the specified descriptor. This method is used mostly * for output to be read by human, not for processing. Consequently, we may consider to returns * a localized name in a future version. */ static String getName(final GeneralParameterDescriptor descriptor) { return descriptor.getName().getCode(); }
/** Work around for RFE #4093999 in Sun's bug database */ private TemporaryIdentifier(final ReferenceIdentifier parent, final int count) { super(Citations.GEOTOOLS, unwrap(parent).getCode() + " (step " + count + ')'); this.parent = parent; this.count = count; }
static boolean isGeostationaryCRS(CoordinateReferenceSystem crs) { if (crs == null) { return false; } String code = crs.getName().getCode(); return ("GEOS".equals(code) || "Geostationary_Satellite".equals(code)); }
/** * Returns the unlocalized operation name. This is different from {@link * AbstractParameter#getName}, which may returns a localized name. */ private String getName() { return descriptor.getName().getCode(); }
/** * Returns the name of the processing operation. The default implementation returns the * {@linkplain #descriptor} code name. * * @todo The return type will be changed from {@link String} to {@link Identifier}. */ public String getName() { return descriptor.getName().getCode(); }
/** Returns a temporary name for object derived from the specified one. */ private static Map<String, ?> getTemporaryName(final IdentifiedObject source) { return Collections.singletonMap( IdentifiedObject.NAME_KEY, source.getName().getCode() + " (3D)"); } }
public void setSrsNameAttribute(AttributesImpl atts, CoordinateReferenceSystem crs) { URI srsName = GML3EncodingUtils.toURI(crs, srsSyntax); String crsName = srsName != null ? srsName.toString() : crs.getName().getCode(); atts.addAttribute(null, "srsName", "srsName", null, crsName); }
/** Ensures the the specified parameter is valid. */ private static void ensureValid(final ParameterDescriptor param, double value) { if (!(value > 0)) { throw new IllegalStateException( Errors.format(ErrorKeys.MISSING_PARAMETER_$1, param.getName().getCode())); } } }
/** * Prints the elements of a descriptor group to the output stream. * * @param descriptor The descriptor group to format. * @throws IOException if an error occured will writing to the stream. */ public void format(final ParameterDescriptorGroup descriptor) throws IOException { synchronized (lock) { format(descriptor.getName().getCode(), descriptor, null); } }
/** * Returns {@code true} if the {@linkplain #getName() primary name} of an object matches the * primary name of one {@linkplain #getAlias alias} of the other object. * * @param o1 The first object to compare by name. * @param o2 The second object to compare by name. * @return {@code true} if both objects have a common name. * @since 2.4 */ public static boolean nameMatches(final IdentifiedObject o1, final IdentifiedObject o2) { return nameMatches(o1, o2.getName().getCode()) || nameMatches(o2, o1.getName().getCode()); }
AbstractGridFormat.USE_JAI_IMAGEREAD.getName().getCode(), Boolean.FALSE);
@Test public void testIdentifier() throws NoSuchAuthorityCodeException, FactoryException { Set<ReferenceIdentifier> identifiers = CartesianAuthorityFactory.GENERIC_2D.getIdentifiers(); assertEquals(1, identifiers.size()); final ReferenceIdentifier id = identifiers.iterator().next(); assertEquals(Citations.EPSG, id.getAuthority()); assertEquals(CODE, id.getCode()); }
/** Tests the {@link DefaultCoordinateSystemAxis#nameMatches} method. */ @Test public void testNameMatches() { assertTrue(LONGITUDE.nameMatches(GEODETIC_LONGITUDE.getName().getCode())); assertFalse(LONGITUDE.nameMatches(GEODETIC_LATITUDE.getName().getCode())); assertFalse(LONGITUDE.nameMatches(ALTITUDE.getName().getCode())); assertFalse(X.nameMatches(LONGITUDE.getName().getCode())); assertFalse(X.nameMatches(EASTING.getName().getCode())); assertFalse(X.nameMatches(NORTHING.getName().getCode())); }
/** UDIG requires this to work. */ @Test public void test42001() throws FactoryException { final ProjectedCRS utm = factory.createProjectedCRS("AUTO:42001,0.0,0.0"); assertNotNull("auto-utm", utm); assertSame(utm, factory.createObject("AUTO :42001 ,0,0")); assertSame(utm, factory.createObject("AUTO2:42001 ,0,0")); assertSame(utm, factory.createObject("42001 ,0,0")); assertNotSame(utm, factory.createObject("AUTO :42001 ,30,0")); assertEquals( "Transverse_Mercator", utm.getConversionFromBase().getMethod().getName().getCode()); }
/** Check we can parse also the unit */ @Test public void test42001Units() throws FactoryException { final ProjectedCRS utm = factory.createProjectedCRS("AUTO:42001,9001,0.0,0.0"); assertNotNull("auto-utm", utm); assertSame(utm, factory.createObject("AUTO :42001, 9001,0,0")); assertSame(utm, factory.createObject("AUTO2:42001, 9001,0,0")); assertSame(utm, factory.createObject("42001, 9001,0,0")); assertNotSame(utm, factory.createObject("AUTO :42001, 9001,30,0")); assertEquals( "Transverse_Mercator", utm.getConversionFromBase().getMethod().getName().getCode()); }