Package org.opengis.util

Examples of org.opengis.util.InternationalString


     * @param  title The title or alternate title to compare.
     * @return {@code true} if the title or alternate title matches the given string.
     */
    public static boolean titleMatches(final Citation citation, String title) {
        title = title.trim();
        InternationalString candidate = citation.getTitle();
        Iterator<? extends InternationalString> iterator = null;
        do {
            // The "null" locale argument is required for getting the unlocalized version.
            final String asString = candidate.toString(null);
            if (asString.trim().equalsIgnoreCase(title)) {
                return true;
            }
            final String asLocalized = candidate.toString();
            if (asLocalized!=asString && asLocalized.trim().equalsIgnoreCase(title)) {
                return true;
            }
            if (iterator == null) {
                final Collection<? extends InternationalString> titles = citation.getAlternateTitles();
View Full Code Here


      HashSet<SampleDimension> samples = new HashSet<SampleDimension>(Arrays.asList(sampleDimensions));
     
      SampleDimension sample = sampleDimensions[0];
     
      Name name = new NameImpl("DEM");
      InternationalString description = sample.getDescription();
      Unit<?> unit = Unit.ONE;
      final List<Axis<?,?>> axes = new ArrayList<Axis<?,?>>();
      axes.add( HSV.INTENSITY_AXIS );
      FieldType field = new DefaultFieldType( name, description, unit, axes, samples);     
     
View Full Code Here

                                  }
                              }
                          }
                    }
                    final Name nameImpl = new NameImpl(coverageName.getLocalPart(), elementName);
                    final InternationalString description = new SimpleInternationalString(product!=null?product.getDescription():elementName);

                    // setting bands names.
                    final GridSampleDimension gridBand = Utilities.buildBands(band, elementName, unit);
                    final HDF4ProductFieldType fd = new HDF4ProductFieldType(nameImpl, description, gridBand);
                    fields.put(elementName, fd);
                }

                // //
                //
                // Updating the sliceDescriptor Map
                //
                // //
                sliceDescriptorsMap.put(imageIndex, sd);
                spatioTemporalMetadataMap.put(imageIndex, metadata);
            }

            // //
            //
            // Checking sets
            //
            // //
            for (Name covName : coverageNames) {
//            for (Name covName : verticalExtentMap.keySet()) {
//                Set<NumberRange<Double>> verticalExtent = verticalExtentMap.get(covName);
//                if (verticalExtent.size() == 0) {
//                    verticalExtent = Collections.emptySet();
//                    verticalExtentMap.put(covName, verticalExtent);
//                }
                Set<TemporalGeometricPrimitive> temporalExtent = temporalExtentMap.get(covName);
                if (temporalExtent.size() == 0) {
                    temporalExtent = Collections.emptySet();
                    temporalExtentMap.put(covName, temporalExtent);
                }

                // //
                //
                // Setting a proper RangeType using the FieldTypes found
                //
                // //
                Map<String, HDF4ProductFieldType> fields = (LinkedHashMap<String, HDF4ProductFieldType>) fieldsMap.get(covName);
                if (fields != null && !fields.isEmpty()) {
                    final Set<FieldType> fieldTypes = new LinkedHashSet<FieldType>(fields.size());
                    final StringBuilder sb = new StringBuilder();
                    for (HDF4ProductFieldType fd : fields.values()) {
                        fieldTypes.add(fd);
                        final InternationalString description = fd.getDescription();
                        sb.append(description != null ? description.toString()+ "," : "");
                    }
                    String description = sb.toString();
                    int pos = -1;
                    if (description.length() > 0 && (pos = description.lastIndexOf(",")) != -1) {
                        description = description.substring(0, pos);
                    }
                    DefaultRangeType range = new DefaultRangeType(covName,new SimpleInternationalString(description),fieldTypes);
                    rangeMap.put(covName, range);
                }
            }
View Full Code Here

        /*
         * Performs the operation using JAI and construct the new grid coverage. Uses the coordinate system from the main source coverage in order to
         * preserve the extra dimensions (if any). The first two dimensions should be equal to the coordinate system set in the 'parameters' block.
         */
        final InternationalString name = deriveName(sources, primarySourceIndex, null);
        final CoordinateReferenceSystem crs = primarySource.getCoordinateReferenceSystem();
        final MathTransform toCRS = parameters.gridToCRS;
        final RenderedImage data = createRenderedImage(parameters.parameters, hints);
        final Map properties = getProperties(data, crs, name, toCRS, sources, null);
        return getFactory(parameters.hints).create(name, // The grid coverage name
View Full Code Here

//

private void examleText() throws Exception {
    // exampleText start
   
    InternationalString greeting;
   
    // simple text place holder
    greeting = Text.text("hello world");
   
    // translated text for an internationalized application
    // useful as message.properties, message_fr.properties etc can be translated
    // outside of your application
    greeting = Text.text("greeting", "message.properties");
   
    // the next method is good for quickly doing things as a developer
    Map<String,String> translations = new HashMap<String,String>();
    translations.put("greeting", "Hello World");
    translations.put( "greeting_it", "ciao mondo");
   
    greeting = Text.text("greeting", translations );
   
    // you can actually use the same map to configure several international strings
    // (each string will only pick up the entries with a matching key)
    //
    // With that in mind we make a special effort to allow you to use properties
    Properties properties = new Properties();
    properties.load( new FileInputStream("message.properties") );
   
    InternationalString title = Text.text( "title", properties );
    InternationalString description = Text.text( "description", properties );
   
    // exampleText end
}
View Full Code Here

     * the alias, it still possible to consider two objects are equivalent even if their names
     * were formatted in different locales.
     */
    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());
        properties.put(ALIAS_KEY, name);
        return properties;
    }
View Full Code Here

        table.writeHorizontalSeparator();
        for (final String code : codes) {
            table.write(code);
            table.nextColumn();
            try {
                final InternationalString description = factory.getDescriptionText(code);
                if (description != null) {
                    table.write(description.toString());
                }
            } catch (NoSuchAuthorityCodeException e) {
                table.write(e.getLocalizedMessage());
            }
            table.nextLine();
View Full Code Here

                /*
                 * Since WKT often use abbreviations, search for the shortest
                 * title or alternate title. If one is found, it will be used
                 * as the authority name (e.g. "EPSG").
                 */
                InternationalString inter = authority.getTitle();
                String title = (inter!=null) ? inter.toString(symbols.locale) : null;
                for (final InternationalString alt : authority.getAlternateTitles()) {
                    if (alt != null) {
                        final String candidate = alt.toString(symbols.locale);
                        if (candidate != null) {
                            if (title==null || candidate.length() < title.length()) {
View Full Code Here

             * Computes the positional accuracy as the RMS value of differences
             * between the computed target points and the supplied target points.
             */
            final double error = getErrorStatistics().rms();
            if (!Double.isNaN(error)) {
                final InternationalString description =
                        Vocabulary.formatInternational(VocabularyKeys.ROOT_MEAN_SQUARED_ERROR);
                final QuantitativeResultImpl result = new QuantitativeResultImpl();
                result.setValues(new double[] {error});
                //result.setValueType(Double.TYPE);
                result.setValueUnit(CRSUtilities.getUnit(targetCRS.getCoordinateSystem()));
View Full Code Here

     * the alias, it still possible to consider two objects are equivalent even if their names
     * were formatted in different locales.
     */
    static Map<String,?> 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());
        properties.put(ALIAS_KEY, name);
        return properties;
    }
View Full Code Here

TOP

Related Classes of org.opengis.util.InternationalString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.