Statistics
| Revision:

root / org.gvsig.proj / branches / refactor2018 / org.gvsig.proj / org.gvsig.proj.catalog / org.gvsig.proj.catalog.api / src / main / java / org / gvsig / proj / catalogue / datum / Ellipsoid.java @ 793

History | View | Annotate | Download (7.97 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2018 gvSIG Association.
5
 * 
6
 * This file has been adapted from GeoAPI, see 
7
 * the original copyright headers bellow.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
 * MA  02110-1301, USA.
23
 *
24
 * For any additional information, do not hesitate to contact us
25
 * at info AT gvsig.com, or visit our website www.gvsig.com.
26
 * 
27
 * ----------
28
 * 
29
 *    GeoAPI - Java interfaces for OGC/ISO standards
30
 *    http://www.geoapi.org
31
 *
32
 *    Copyright (C) 2004-2017 Open Geospatial Consortium, Inc.
33
 *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
34
 *
35
 *    Permission to use, copy, and modify this software and its documentation, with
36
 *    or without modification, for any purpose and without fee or royalty is hereby
37
 *    granted, provided that you include the following on ALL copies of the software
38
 *    and documentation or portions thereof, including modifications, that you make:
39
 *
40
 *    1. The full text of this NOTICE in a location viewable to users of the
41
 *       redistributed or derivative work.
42
 *    2. Notice of any changes or modifications to the OGC files, including the
43
 *       date changes were made.
44
 *
45
 *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
46
 *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
47
 *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
48
 *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
49
 *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
50
 *
51
 *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
52
 *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
53
 *
54
 *    The name and trademarks of copyright holders may NOT be used in advertising or
55
 *    publicity pertaining to the software without specific, written prior permission.
56
 *    Title to copyright in this software and any associated documentation will at all
57
 *    times remain with copyright holders.
58
 */
59

    
60
package org.gvsig.proj.catalogue.datum;
61

    
62
import javax.measure.quantity.Length;
63
import javax.measure.unit.Unit;
64

    
65

    
66
/**
67
 * Geometric figure that can be used to describe the approximate shape of the earth.
68
 * In mathematical terms, it is a surface formed by the rotation of an ellipse about
69
 * its minor axis. An ellipsoid requires two defining parameters:
70
 *
71
 * <ul>
72
 *   <li>{@linkplain #getSemiMajorAxis() semi-major axis} and
73
 *       {@linkplain #getInverseFlattening() inverse flattening}, or</li>
74
 *   <li>{@linkplain #getSemiMajorAxis() semi-major axis} and
75
 *       {@linkplain #getSemiMinorAxis() semi-minor axis}.</li>
76
 * </ul>
77
 *
78
 * There is not just one ellipsoid. An ellipsoid is a matter of choice, and therefore many
79
 * choices are possible. The size and shape of an ellipsoid was traditionally chosen such
80
 * that the surface of the geoid is matched as closely as possible locally, e.g. in a country.
81
 * A number of global best-fit ellipsoids are now available. An association of an ellipsoid with
82
 * the earth is made through the definition of the size and shape of the ellipsoid and the position
83
 * and orientation of this ellipsoid with respect to the earth. Collectively this choice is captured
84
 * by the concept of "{@linkplain GeodeticDatum geodetic datum}". A change of size, shape, position
85
 * or orientation of an ellipsoid will result in a change of geographic coordinates of a point and
86
 * be described as a different geodetic datum. Conversely geographic coordinates are unambiguous
87
 * only when associated with a geodetic datum.
88
 *   
89
 * @departure constraint
90
 *   ISO 19111 defines the union named <code>secondDefiningParameter</code>
91
 *   as being either <code>semiMinorAxis</code> or <code>inverseFlattening</code>.
92
 *   The <code>union</code> construct (defined in some languages like C/C++) does not exist in Java.
93
 *   GeoAPI changed the interface to require both ellipsoidal parameters (in addition to the <code>semiMajorAxis</code>
94
 *   parameter which is mandatory in any case), as was done in <a href="http://www.opengeospatial.org/standards/ct">OGC 01-009</a>.
95
 *   However, implementors could readily permit users to only provide one of the two parameters
96
 *   by creating a class which calculates the second parameter from the first.
97
 *   For precision, GeoAPI imports the <code>isIvfDefinitive</code> attribute from OGC 01-009
98
 *   to enable the user to establish which of the two parameters was used to define the instance.
99
 *
100
 * Note: gvSIG derived these interfaces from GeoAPI in order to have a simpler API and also to
101
 * avoid namespace collisions (e.g. GeoAPI 3 vs GeoTools interfaces). There is no plans
102
 * to evolve these interfaces to adapt them to future GeoAPI versions.
103
 * 
104
 * @author  gvSIG Team
105
 * @author  Martin Desruisseaux (IRD)
106
 * @version 3.0.1
107
 * @since   1.0
108
 *
109
 * @see DatumAuthorityFactory#createEllipsoid(String)
110
 * @see DatumFactory#createEllipsoid(Map, double, double, Unit)
111
 * @see DatumFactory#createFlattenedSphere(Map, double, double, Unit)
112
 */
113
public interface Ellipsoid {
114
            /**
115
             * Returns the linear unit of the {@linkplain #getSemiMajorAxis() semi-major}
116
             * and {@linkplain #getSemiMinorAxis() semi-minor} axis values.
117
             *
118
             * @return the axis linear unit.
119
             */
120
            Unit<Length> getAxisUnit();
121

    
122
            /**
123
             * Length of the semi-major axis of the ellipsoid. This is the
124
             * equatorial radius in {@linkplain #getAxisUnit() axis linear unit}.
125
             *
126
             * @return length of semi-major axis.
127
             * @unitof Length
128
             */
129
            double getSemiMajorAxis();
130

    
131
            /**
132
             * Length of the semi-minor axis of the ellipsoid. This is the
133
             * polar radius in {@linkplain #getAxisUnit() axis linear unit}.
134
             *
135
             * @return length of semi-minor axis.
136
             * @unitof Length
137
             */
138
            double getSemiMinorAxis();
139

    
140
            /**
141
             * Returns the value of the inverse of the flattening constant. The inverse
142
             * flattening is related to the equatorial/polar radius by the formula
143
             *
144
             * <var>ivf</var>&nbsp;=&nbsp;<var>r</var><sub>e</sub>/(<var>r</var><sub>e</sub>-<var>r</var><sub>p</sub>).
145
             *
146
             * For perfect spheres (i.e. if {@link #isSphere()} returns {@code true}),
147
             * the {@link Double#POSITIVE_INFINITY POSITIVE_INFINITY} value is used.
148
             *
149
             * @return the inverse flattening value.
150
             * @unitof Scale
151
             */
152
            double getInverseFlattening();
153

    
154
            /**
155
             * Indicates if the {@linkplain #getInverseFlattening() inverse flattening} is definitive for
156
             * this ellipsoid. Some ellipsoids use the IVF as the defining value, and calculate the polar
157
             * radius whenever asked. Other ellipsoids use the polar radius to calculate the IVF whenever
158
             * asked. This distinction can be important to avoid floating-point rounding errors.
159
             *
160
             * @return {@code true} if the {@linkplain #getInverseFlattening() inverse flattening} is
161
             *         definitive, or {@code false} if the {@linkplain #getSemiMinorAxis() polar radius}
162
             *         is definitive.
163
             */
164
            boolean isIvfDefinitive();
165

    
166
            /**
167
             * {@code true} if the ellipsoid is degenerate and is actually a sphere. The sphere is
168
             * completely defined by the {@linkplain #getSemiMajorAxis() semi-major axis}, which is
169
             * the radius of the sphere.
170
             *
171
             * @return {@code true} if the ellipsoid is degenerate and is actually a sphere.
172
             */
173
            boolean isSphere();
174
}