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.spatial;
021:
022: // J2SE direct dependencies
023: import java.util.List;
024: import java.util.Collection;
025:
026: // OpenGIS dependencies
027: import org.opengis.metadata.citation.Citation;
028: import org.opengis.metadata.spatial.CellGeometry;
029: import org.opengis.metadata.spatial.Georeferenceable;
030: import org.opengis.util.InternationalString;
031: import org.opengis.util.Record;
032:
033: /**
034: * Grid with cells irregularly spaced in any given geographic/map projection coordinate
035: * system, whose individual cells can be geolocated using geolocation information
036: * supplied with the data but cannot be geolocated from the grid properties alone.
037: *
038: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/metadata/iso/spatial/GeoreferenceableImpl.java $
039: * @version $Id: GeoreferenceableImpl.java 25189 2007-04-17 13:23:47Z desruisseaux $
040: * @author Martin Desruisseaux
041: * @author Touraïvane
042: *
043: * @since 2.1
044: */
045: public class GeoreferenceableImpl extends GridSpatialRepresentationImpl
046: implements Georeferenceable {
047: /**
048: * Serial number for interoperability with different versions.
049: */
050: private static final long serialVersionUID = 5203270142818028946L;
051:
052: /**
053: * Indication of whether or not control point(s) exists.
054: */
055: private boolean controlPointAvailable;
056:
057: /**
058: * Indication of whether or not orientation parameters are available.
059: */
060: private boolean orientationParameterAvailable;
061:
062: /**
063: * Description of parameters used to describe sensor orientation.
064: */
065: private InternationalString orientationParameterDescription;
066:
067: /**
068: * Terms which support grid data georeferencing.
069: */
070: private Record georeferencedParameters;
071:
072: /**
073: * Reference providing description of the parameters.
074: */
075: private Collection parameterCitation;
076:
077: /**
078: * Constructs an initially empty georeferenceable.
079: */
080: public GeoreferenceableImpl() {
081: }
082:
083: /**
084: * Constructs a metadata entity initialized with the values from the specified metadata.
085: *
086: * @since 2.4
087: */
088: public GeoreferenceableImpl(final Georeferenceable source) {
089: super (source);
090: }
091:
092: /**
093: * Creates a georeferencable initialized to the given parameters.
094: */
095: public GeoreferenceableImpl(final int numberOfDimensions,
096: final List axisDimensionsProperties,
097: final CellGeometry cellGeometry,
098: final boolean transformationParameterAvailable,
099: final boolean controlPointAvailable,
100: final boolean orientationParameterAvailable) {
101: super (numberOfDimensions, axisDimensionsProperties,
102: cellGeometry, transformationParameterAvailable);
103: setControlPointAvailable(controlPointAvailable);
104: setOrientationParameterAvailable(orientationParameterAvailable);
105: }
106:
107: /**
108: * Indication of whether or not control point(s) exists.
109: */
110: public boolean isControlPointAvailable() {
111: return controlPointAvailable;
112: }
113:
114: /**
115: * Set an indication of whether or not control point(s) exists.
116: */
117: public synchronized void setControlPointAvailable(
118: final boolean newValue) {
119: checkWritePermission();
120: controlPointAvailable = newValue;
121: }
122:
123: /**
124: * Indication of whether or not orientation parameters are available.
125: */
126: public boolean isOrientationParameterAvailable() {
127: return orientationParameterAvailable;
128: }
129:
130: /**
131: * Set an indication of whether or not orientation parameters are available.
132: */
133: public synchronized void setOrientationParameterAvailable(
134: final boolean newValue) {
135: checkWritePermission();
136: orientationParameterAvailable = newValue;
137: }
138:
139: /**
140: * Description of parameters used to describe sensor orientation.
141: */
142: public InternationalString getOrientationParameterDescription() {
143: return orientationParameterDescription;
144: }
145:
146: /**
147: * Set a description of parameters used to describe sensor orientation.
148: */
149: public synchronized void setOrientationParameterDescription(
150: final InternationalString newValue) {
151: checkWritePermission();
152: orientationParameterDescription = newValue;
153: }
154:
155: /**
156: * Terms which support grid data georeferencing.
157: *
158: * @deprecated please use {@link #getGeoreferencedParameters}.
159: */
160: public Object getParameters() {
161: return getGeoreferencedParameters();
162: }
163:
164: /**
165: * Terms which support grid data georeferencing.
166: *
167: * @since 2.4
168: */
169: public Record getGeoreferencedParameters() {
170: return georeferencedParameters;
171: }
172:
173: /**
174: * Set terms which support grid data georeferencing.
175: *
176: * @deprecated please use {@link #setGeoreferencedParameters}.
177: */
178: public void setParameters(final Object newValue) {
179: setGeoreferencedParameters((Record) newValue);
180: }
181:
182: /**
183: * Set terms which support grid data georeferencing.
184: *
185: * @since 2.4
186: */
187: public synchronized void setGeoreferencedParameters(
188: final Record newValue) {
189: checkWritePermission();
190: georeferencedParameters = newValue;
191: }
192:
193: /**
194: * Reference providing description of the parameters.
195: */
196: public synchronized Collection getParameterCitation() {
197: return parameterCitation = nonNullCollection(parameterCitation,
198: Citation.class);
199: }
200:
201: /**
202: * Set reference providing description of the parameters.
203: */
204: public synchronized void setParameterCitation(
205: final Collection newValues) {
206: parameterCitation = copyCollection(newValues,
207: parameterCitation, Citation.class);
208: }
209: }
|