Package org.opengis.util

Examples of org.opengis.util.InternationalString


    public String getTitle() {
        if( factory == null ){
            return "Unavailable";
        }
        InternationalString title = factory.getTitle();
        String text = title == null ? null : title.toString();
        if( text == null ){
            return factory.getClass().getSimpleName();
        }
        else {
            return text;
View Full Code Here


            this.processName = LocalProcess.this.name;
            try {
                this.schema = new URI(processName.getNamespaceURI());
            } catch (URISyntaxException e) {
            }
            InternationalString processDescription = processFactory.getDescription(processName);
            InternationalString processTitle = processFactory.getTitle(processName);

            if (processDescription != null) {
                this.description = processDescription.toString();
            }
            if (processTitle != null) {
                this.title = processTitle.toString();
            }
            String version = processFactory.getVersion(processName);
            if (version != null) {
                this.keywords = new String[]{version};
            }
View Full Code Here

    public static Collection<String> extractAuthorityCodes( CoordinateReferenceSystem crs ) {
         Set<ReferenceIdentifier> identifiers = crs.getIdentifiers();

        Set<String> codes = new HashSet<String>();
        for( ReferenceIdentifier identifier : identifiers ) {
            InternationalString title = identifier.getAuthority().getTitle();
            if (title.toString().equalsIgnoreCase("EPSG")) { //$NON-NLS-1$
                codes.add(identifier.toString());
                break;
            }
            Collection< ? extends InternationalString> alternateTitles = identifier.getAuthority()
                    .getAlternateTitles();
View Full Code Here

            crs = CRS.decode(code);
        } catch (Exception e) {
            //
        }

        InternationalString scope = null;
        InternationalString remarks = null;
        String wkt = "";
        String aovCoords = "";
        String areaOfValidity = "";
        this.jsBbox = "null";
        this.jsSrs = code;
        if (crs != null) {
            // CoordinateSystem coordinateSystem = crs.getCoordinateSystem();
            // coordinateSystem.getName();
            // coordinateSystem.getRemarks();
            // coordinateSystem.getDimension();
            //           
            // if(crs instanceof SingleCRS){
            // Datum datum = ((SingleCRS)crs).getDatum();
            // datum.getName();
            // datum.getAlias();
            // datum.getAnchorPoint();
            // datum.getRemarks();
            // datum.getScope();
            // }

            scope = crs.getScope();
            remarks = crs.getRemarks();

            wkt = crs.toString();
            Extent domainOfValidity = crs.getDomainOfValidity();
            if (domainOfValidity != null) {
                areaOfValidity = domainOfValidity.getDescription() == null ? "" : domainOfValidity
                        .getDescription().toString(locale);
                Collection<? extends GeographicExtent> geographicElements = domainOfValidity
                        .getGeographicElements();
                for (GeographicExtent ex : geographicElements) {
                    aovCoords += " " + ex;
                }
                // Envelope envelope = CRS.getEnvelope(crs);
                // jsBbox = "[" + envelope.getMinimum(0) + "," + envelope.getMinimum(1) + ","
                // + envelope.getMaximum(0) + "," + envelope.getMaximum(1) + "]";
                //
                // jsMaxResolution = getMaxResolution(envelope);

                // GeographicBoundingBox box = CRS.getGeographicBoundingBox(crs);
                // jsBbox = "[" + box.getWestBoundLongitude() + "," + box.getSouthBoundLatitude()
                // + "," + box.getEastBoundLongitude() + "," + box.getNorthBoundLatitude()
                // + "]";

                GeographicBoundingBox box = CRS.getGeographicBoundingBox(crs);

                double westBoundLongitude = box.getWestBoundLongitude();
                double eastBoundLongitude = box.getEastBoundLongitude();
                double southBoundLatitude = box.getSouthBoundLatitude();
                double northBoundLatitude = box.getNorthBoundLatitude();

                double[] dst1;
                double[] dst2;
                try {
                    MathTransform tr = CRS.findMathTransform(CRS.decode("EPSG:4326"), crs, true);
                    dst1 = new double[tr.getTargetDimensions()];
                    dst2 = new double[tr.getTargetDimensions()];
                    double[] src1 = new double[tr.getSourceDimensions()];
                    src1[0] = westBoundLongitude;
                    src1[1] = southBoundLatitude;

                    double[] src2 = new double[tr.getSourceDimensions()];
                    src2[0] = eastBoundLongitude;
                    src2[1] = northBoundLatitude;
                    tr.transform(src1, 0, dst1, 0, 1);
                    tr.transform(src2, 0, dst2, 0, 1);
                } catch (Exception e1) {
                    e1.printStackTrace();
                    throw new RuntimeException(e1);
                }

                double x1 = Math.min(dst1[0], dst2[0]);
                double y1 = Math.min(dst1[1], dst2[1]);
                double x2 = Math.max(dst1[0], dst2[0]);
                double y2 = Math.max(dst1[1], dst2[1]);
                String bbox = "[" + x1 + "," + y1 + "," + x2 + "," + y2 + "]";
                this.jsBbox = bbox;

                double width = x2 - x1;
                double height = y2 - y1;
                double maxres = getMaxResolution(width, height);
                this.jsMaxResolution = maxres;
            }
        }

        add(new Label("crsScope", scope == null ? "-" : scope.toString(locale)));
        add(new Label("crsRemarks", remarks == null ? "-" : remarks.toString(locale)));
        add(new Label("wkt", wkt));
        add(new Label("aovCoords", aovCoords));
        add(new Label("aovDescription", areaOfValidity));

        Image aovMap = new Image("aovMap", new TestResource(crs));
View Full Code Here

        boolean showHeaders  = false;
        boolean showNaNCount = false;
        for (int i=0; i<stats.length; i++) {
            final Statistics s = stats[i];
            showNaNCount |= (s.countNaN() != 0);
            final InternationalString header = s.name();
            if (header != null) {
                headers[i] = header.toString(headerLocale);
                showHeaders |= (headers[i] != null);
            }
        }
        char horizontalLine = 0;
        String separator = columnSeparator;
View Full Code Here

     * using ISO 8601 date format.
     */
    @Override
    public String getVersion() {
        if (authority != null) {
            final InternationalString version = authority.getEdition();
            if (version != null) {
                return version.toString();
            }
        }
        return null;
    }
View Full Code Here

    public static boolean titleMatches(final Citation c1, final Citation c2) {
        if (c1 != null && c2 != null) {
            if (c1 == c2) {
                return true; // Optimisation for a common case.
            }
            InternationalString candidate = c2.getTitle();
            Iterator<? extends InternationalString> iterator = null;
            do {
                if (candidate != null) {
                    final String unlocalized = candidate.toString(Locale.ROOT);
                    if (titleMatches(c1, unlocalized)) {
                        return true;
                    }
                    final String localized = candidate.toString();
                    if (!Objects.equals(localized, unlocalized) // Slight optimization for a common case.
                            && titleMatches(c1, localized))
                    {
                        return true;
                    }
View Full Code Here

     * @return {@code true} if both arguments are non-null, and the title or alternate
     *         title matches the given string.
     */
    public static boolean titleMatches(final Citation citation, final CharSequence title) {
        if (citation != null && title != null) {
            InternationalString candidate = citation.getTitle();
            Iterator<? extends InternationalString> iterator = null;
            do {
                if (candidate != null) {
                    final String unlocalized = candidate.toString(Locale.ROOT);
                    if (equalsFiltered(unlocalized, title, LETTERS_AND_DIGITS, true)) {
                        return true;
                    }
                    final String localized = candidate.toString();
                    if (!Objects.equals(localized, unlocalized) // Slight optimization for a common case.
                            && equalsFiltered(localized, title, LETTERS_AND_DIGITS, true))
                    {
                        return true;
                    }
View Full Code Here

    public static DefaultLocalName castOrCopy(final LocalName object) {
        if (object == null || object instanceof DefaultLocalName) {
            return (DefaultLocalName) object;
        }
        final NameSpace scope = object.scope();
        final InternationalString name = object.toInternationalString();
        final LocalName result;
        if (object instanceof MemberName) {
            result = DefaultFactories.SIS_NAMES.createMemberName(scope, name, ((MemberName) object).getAttributeType());
        } else if (object instanceof TypeName) {
            result = DefaultFactories.SIS_NAMES.createTypeName(scope, name);
View Full Code Here

     * Tests the formatting of an international string.
     */
    @Test
    @DependsOnMethod("testGetResources")
    public void testFormatInternational() {
        InternationalString i18n = Errors.formatInternational(Errors.Keys.NullArgument_1);
        assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ROOT));
        assertEquals("Argument ‘{0}’ shall not be null.",      i18n.toString(Locale.ENGLISH));
        assertEquals("L’argument ‘{0}’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
        assertNotSame(i18n, assertSerializedEquals(i18n));

        i18n = Errors.formatInternational(Errors.Keys.NullArgument_1, "CRS");
        assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ROOT));
        assertEquals("Argument ‘CRS’ shall not be null.",      i18n.toString(Locale.ENGLISH));
        assertEquals("L’argument ‘CRS’ ne doit pas être nul.", i18n.toString(Locale.FRENCH));
        assertNotSame(i18n, assertSerializedEquals(i18n));
    }
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.