Revision 827 org.gvsig.proj/branches/refactor2018/org.gvsig.proj/org.gvsig.proj.lib/org.gvsig.proj.lib.api/src/main/java/org/gvsig/proj/CoordinateReferenceSystem.java

View differences:

CoordinateReferenceSystem.java
25 25
import javax.measure.Unit;
26 26
import javax.measure.quantity.Length;
27 27

  
28
import org.cresques.cts.IProjection;
28 29
import org.gvsig.proj.catalog.CRSDefinition;
30
import org.gvsig.proj.catalog.CRSType;
31
import org.gvsig.proj.catalog.TransformationDefinition;
32
import org.gvsig.proj.catalog.exception.CoordinateReferenceSystemException;
33
import org.gvsig.proj.catalog.exception.TransformationException;
29 34
import org.gvsig.proj.catalog.exception.UnsupportedCoordinateReferenceSystemException;
30 35
import org.gvsig.tools.lang.Cloneable;
31 36

  
......
48 53
     * fully defines the CRS
49 54
     * 
50 55
     * @return
51
     * @throws UnsupportedOperationException 
52
     * @throws UnsupportedCoordinateReferenceSystemException 
53 56
     */
54
    CRSDefinition getDefinition() throws UnsupportedCoordinateReferenceSystemException, UnsupportedOperationException;
57
    CRSDefinition getDefinition();
55 58
    
56 59
    /**
60
     * Some CRSs include a projection, which defines a mathematical model to approximate
61
     * the surface of an area of the earth using a planar surface. CRS including a
62
     * projection are called projected CRSs
63
     * 
64
     * @return true if the CRS is projected, false otherwise. It also returns true
65
     * for derived CRSs whose {@link #getBaseCRS() base CRS} is a projected CRS
66
     */
67
    boolean isProjected();
68
    
69
    /**
70
     * Returns true if the CRS is geographic. It also returns true for derived CRSs
71
     * whose {@link #getBaseCRS() base CRS} is a geographic CRS. 
72
     * 
73
     * @return
74
     */
75
    boolean isGeographic();
76
    
77
    /**
78
     * If this CRS is a projected CRS (or a derived CRS whose base CRS is a projected
79
     * CRS), it converts coordinates from this CoordinateReferenceSystem to the
80
     * base Geographic CRS. If the CRS is a geographic CRS, it returns the same
81
     * coordinates without further transformation.
82
     * 
83
     * @param point
84
     * @return
85
     * @throws TransformationException if {@link #isProjected()} and 
86
     * {@link #isGeographic()} are both false
87
     */
88
    double[] toGeo(double[] point) throws TransformationException;
89

  
90
    
91
    /**
57 92
     * Calculates the distance between 2 points on the surface of the Earth.
58 93
     * 
59 94
     * The distances are calculated based on the characteristics of CRSDefinition,
......
73 108
     * 
74 109
     * @return The distance between point1 and point2 measured in the units
75 110
     * provided by the unit parameter.
111
     * @throws CoordinateReferenceSystemException if an error is produced calculating the distance
76 112
     */
77
    double getDistance(double[] point1, double[] point2, Unit<Length> unit);
113
    double getDistance(double[] point1, double[] point2, Unit<Length> unit) throws CoordinateReferenceSystemException;
78 114

  
79 115
    /**
80 116
     * Calculates the distance between 2 points on the surface of the Earth.
......
100 136
     * 
101 137
     * @return The distance between point1 and point2 measured in the units
102 138
     * provided by the unit parameter.
139
     * @throws CoordinateReferenceSystemException if an error is produced calculating the distance
103 140
     */
104
    double getDistance(double[] point1, double[] point2, boolean useBaseCRS, Unit<Length> unit);
141
    double getDistance(double[] point1, double[] point2, boolean useBaseCRS, Unit<Length> unit) throws CoordinateReferenceSystemException;
142
    
143
    /**
144
     * Returns a legacy IProjection object, the interface used in older gvSIG
145
     * versions to represent CoordinateReferenceSystems. This method will be
146
     * removed in the future, so migrate your code to {@link CoordinateReferenceSystem}
147
     * and the new API as soon as possible.
148
     * 
149
     * @return
150
     */
151
    @Deprecated
152
    IProjection getIProjection();
105 153
}

Also available in: Unified diff