44import org .locationtech .proj4j .units .Unit ;
55import org .locationtech .proj4j .units .Units ;
66
7+ import mil .nga .crs .CRS ;
8+
79/**
810 * Single Projection for an authority and code
911 *
@@ -22,7 +24,7 @@ public class Projection {
2224 private final String code ;
2325
2426 /**
25- * Coordinate Reference System
27+ * Projection Coordinate Reference System
2628 */
2729 private final CoordinateReferenceSystem crs ;
2830
@@ -31,6 +33,11 @@ public class Projection {
3133 */
3234 private final String definition ;
3335
36+ /**
37+ * Definition parsed Coordinate Reference System
38+ */
39+ private final CRS definitionCRS ;
40+
3441 /**
3542 * Constructor
3643 *
@@ -39,7 +46,7 @@ public class Projection {
3946 * @param code
4047 * coordinate code
4148 * @param crs
42- * crs
49+ * projection coordinate reference system
4350 */
4451 public Projection (String authority , long code ,
4552 CoordinateReferenceSystem crs ) {
@@ -54,7 +61,7 @@ public Projection(String authority, long code,
5461 * @param code
5562 * coordinate code
5663 * @param crs
57- * crs
64+ * projection coordinate reference system
5865 */
5966 public Projection (String authority , String code ,
6067 CoordinateReferenceSystem crs ) {
@@ -69,13 +76,13 @@ public Projection(String authority, String code,
6976 * @param code
7077 * coordinate code
7178 * @param crs
72- * crs
79+ * projection coordinate reference system
7380 * @param definition
7481 * well-known text coordinate definition
7582 */
7683 public Projection (String authority , long code ,
7784 CoordinateReferenceSystem crs , String definition ) {
78- this (authority , String . valueOf ( code ) , crs , definition );
85+ this (authority , code , crs , definition , null );
7986 }
8087
8188 /**
@@ -86,12 +93,52 @@ public Projection(String authority, long code,
8693 * @param code
8794 * coordinate code
8895 * @param crs
89- * crs
96+ * projection coordinate reference system
9097 * @param definition
9198 * well-known text coordinate definition
9299 */
93100 public Projection (String authority , String code ,
94101 CoordinateReferenceSystem crs , String definition ) {
102+ this (authority , code , crs , definition , null );
103+ }
104+
105+ /**
106+ * Constructor
107+ *
108+ * @param authority
109+ * coordinate authority
110+ * @param code
111+ * coordinate code
112+ * @param crs
113+ * projection coordinate reference system
114+ * @param definition
115+ * well-known text coordinate definition
116+ * @param definitionCRS
117+ * definition parsed coordinate reference system
118+ */
119+ public Projection (String authority , long code ,
120+ CoordinateReferenceSystem crs , String definition ,
121+ CRS definitionCRS ) {
122+ this (authority , String .valueOf (code ), crs , definition , definitionCRS );
123+ }
124+
125+ /**
126+ * Constructor
127+ *
128+ * @param authority
129+ * coordinate authority
130+ * @param code
131+ * coordinate code
132+ * @param crs
133+ * projection coordinate reference system
134+ * @param definition
135+ * well-known text coordinate definition
136+ * @param definitionCRS
137+ * definition parsed coordinate reference system
138+ */
139+ public Projection (String authority , String code ,
140+ CoordinateReferenceSystem crs , String definition ,
141+ CRS definitionCRS ) {
95142 if (authority == null || code == null || crs == null ) {
96143 throw new IllegalArgumentException (
97144 "All projection arguments are required. authority: "
@@ -101,6 +148,7 @@ public Projection(String authority, String code,
101148 this .code = code ;
102149 this .crs = crs ;
103150 this .definition = definition ;
151+ this .definitionCRS = definitionCRS ;
104152 }
105153
106154 /**
@@ -124,7 +172,7 @@ public String getCode() {
124172 /**
125173 * Get the Coordinate Reference System
126174 *
127- * @return Coordinate Reference System
175+ * @return coordinate reference system
128176 */
129177 public CoordinateReferenceSystem getCrs () {
130178 return crs ;
@@ -139,6 +187,15 @@ public String getDefinition() {
139187 return definition ;
140188 }
141189
190+ /**
191+ * Get the definition parsed Coordinate Reference System
192+ *
193+ * @return coordinate reference system
194+ */
195+ public CRS getDefinitionCRS () {
196+ return definitionCRS ;
197+ }
198+
142199 /**
143200 * Get the transformation from this Projection to the EPSG code. Each thread
144201 * of execution should have it's own transformation.
0 commit comments