001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2004, Institut de Recherche pour le Développement
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation;
010: * version 2.1 of the License.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * This package contains documentation from OpenGIS specifications.
018: * OpenGIS consortium's work is fully acknowledged here.
019: */
020: package org.geotools.metadata.iso.quality;
021:
022: // OpenGIS direct dependencies
023: import org.opengis.metadata.quality.Result;
024: import org.opengis.metadata.quality.EvaluationMethodType;
025: import org.opengis.metadata.quality.PositionalAccuracy;
026: import org.opengis.util.InternationalString;
027:
028: // Geotools dependencies
029: import org.geotools.metadata.iso.citation.Citations;
030: import org.geotools.util.SimpleInternationalString;
031:
032: /**
033: * Accuracy of the position of features.
034: *
035: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/quality/PositionalAccuracyImpl.java $
036: * @version $Id: PositionalAccuracyImpl.java 25175 2007-04-16 13:40:57Z desruisseaux $
037: * @author Martin Desruisseaux
038: * @author Touraïvane
039: *
040: * @since 2.1
041: */
042: public class PositionalAccuracyImpl extends ElementImpl implements
043: PositionalAccuracy {
044: /**
045: * Serial number for interoperability with different versions.
046: */
047: private static final long serialVersionUID = 6043381860937480828L;
048:
049: /**
050: * Indicates that a {@linkplain org.opengis.referencing.operation.Transformation transformation}
051: * requires a datum shift and some method has been applied. Datum shift methods often use
052: * {@linkplain org.geotools.referencing.datum.BursaWolfParameters Bursa Wolf parameters},
053: * but other kind of method may have been applied as well.
054: *
055: * @see org.opengis.referencing.operation.Transformation#getPositionalAccuracy
056: * @see org.geotools.referencing.operation.AbstractCoordinateOperationFactory#DATUM_SHIFT
057: */
058: public static final PositionalAccuracy DATUM_SHIFT_APPLIED;
059:
060: /**
061: * Indicates that a {@linkplain org.opengis.referencing.operation.Transformation transformation}
062: * requires a datum shift, but no method has been found applicable. This usually means that no
063: * {@linkplain org.geotools.referencing.datum.BursaWolfParameters Bursa Wolf parameters} have
064: * been found. Such datum shifts are approximative and may have 1 kilometer error. This
065: * pseudo-transformation is allowed by
066: * {@linkplain org.geotools.referencing.operation.DefaultCoordinateOperationFactory coordinate
067: * operation factory} only if it was created with
068: * {@link org.geotools.factory.Hints#LENIENT_DATUM_SHIFT} set to {@link Boolean#TRUE}.
069: *
070: * @see org.opengis.referencing.operation.Transformation#getPositionalAccuracy
071: * @see org.geotools.referencing.operation.AbstractCoordinateOperationFactory#ELLIPSOID_SHIFT
072: */
073: public static final PositionalAccuracy DATUM_SHIFT_OMITTED;
074: static {
075: // TODO: localize.
076: final InternationalString desc = new SimpleInternationalString(
077: "Transformation accuracy");
078: final InternationalString eval = new SimpleInternationalString(
079: "Is a datum shift method applied?");
080: final ConformanceResultImpl pass = new ConformanceResultImpl(
081: Citations.GEOTOOLS, eval, true);
082: final ConformanceResultImpl fail = new ConformanceResultImpl(
083: Citations.GEOTOOLS, eval, false);
084: pass.freeze();
085: fail.freeze();
086: final PositionalAccuracyImpl APPLIED, OMITTED;
087: DATUM_SHIFT_APPLIED = APPLIED = new AbsoluteExternalPositionalAccuracyImpl(
088: pass);
089: DATUM_SHIFT_OMITTED = OMITTED = new AbsoluteExternalPositionalAccuracyImpl(
090: fail);
091: APPLIED.setMeasureDescription(desc);
092: OMITTED.setMeasureDescription(desc);
093: APPLIED.setEvaluationMethodDescription(eval);
094: OMITTED.setEvaluationMethodDescription(eval);
095: APPLIED
096: .setEvaluationMethodType(EvaluationMethodType.DIRECT_INTERNAL);
097: OMITTED
098: .setEvaluationMethodType(EvaluationMethodType.DIRECT_INTERNAL);
099: APPLIED.freeze();
100: OMITTED.freeze();
101: }
102:
103: /**
104: * Constructs an initially empty positional accuracy.
105: */
106: public PositionalAccuracyImpl() {
107: }
108:
109: /**
110: * Constructs a metadata entity initialized with the values from the specified metadata.
111: *
112: * @since 2.4
113: */
114: public PositionalAccuracyImpl(final PositionalAccuracy source) {
115: super (source);
116: }
117:
118: /**
119: * Creates an positional accuracy initialized to the given result.
120: */
121: public PositionalAccuracyImpl(final Result result) {
122: super(result);
123: }
124: }
|