Skip to content

Commit 57f0078

Browse files
committed
method and parameter parsing updates
1 parent c51cbae commit 57f0078

3 files changed

Lines changed: 85 additions & 10 deletions

File tree

src/main/java/mil/nga/crs/projected/MapProjectionMethods.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ public enum MapProjectionMethods {
6969
* Lambert Conic Conformal (1SP)
7070
*/
7171
LAMBERT_CONIC_CONFORMAL_1SP("Lambert Conic Conformal (1SP)",
72-
new String[] { "Lambert Conic Conformal", "LCC" }, 9801, 8801, 8802,
73-
8805, 8806, 8807),
72+
new String[] { "Lambert Conic Conformal", "LCC",
73+
"Lambert Conformal Conic 1SP" },
74+
9801, 8801, 8802, 8805, 8806, 8807),
7475

7576
/**
7677
* Lambert Conic Conformal (2SP)
7778
*/
7879
LAMBERT_CONIC_CONFORMAL_2SP("Lambert Conic Conformal (2SP)",
79-
new String[] { "Lambert Conic Conformal", "LCC" }, 9802, 8821, 8822,
80-
8823, 8824, 8826, 8827),
80+
new String[] { "Lambert Conic Conformal", "LCC",
81+
"Lambert Conformal Conic 2SP" },
82+
9802, 8821, 8822, 8823, 8824, 8826, 8827),
8183

8284
/**
8385
* Lambert Cylindrical Equal Area (Spherical)
@@ -260,7 +262,9 @@ private MapProjectionMethods(String name, String[] aliases, int code,
260262
*/
261263
private void addAlias(String alias) {
262264
aliases.add(alias);
263-
aliases.add(alias.replaceAll(" ", "_"));
265+
String underscore = alias.replaceAll(" ", "_");
266+
aliases.add(underscore);
267+
aliases.add(underscore.replace("(", "").replace(")", ""));
264268
}
265269

266270
/**

src/main/java/mil/nga/crs/projected/MapProjectionParameters.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public enum MapProjectionParameters {
4545
* application of false coordinates has grid coordinates of (0,0).
4646
*/
4747
LONGITUDE_OF_NATURAL_ORIGIN(8802, "longitude of natural origin",
48-
UnitType.ANGLEUNIT, "longitude of origin", "central meridian",
49-
"longitude of center"),
48+
UnitType.ANGLEUNIT, "longitude of origin", "longitude of center",
49+
"central meridian"),
5050

5151
/**
5252
*
@@ -145,7 +145,8 @@ public enum MapProjectionParameters {
145145
* which grid coordinate values false easting and false northing are defined
146146
*/
147147
LONGITUDE_OF_FALSE_ORIGIN(8822, "longitude of false origin",
148-
UnitType.ANGLEUNIT, "longitude of origin"),
148+
UnitType.ANGLEUNIT, "longitude of origin", "longitude of center",
149+
"central meridian"),
149150

150151
/**
151152
* geodetic latitude of one of the parallels of intersection of the cone
@@ -155,7 +156,7 @@ public enum MapProjectionParameters {
155156
* Scale is true along this parallel.
156157
*/
157158
LATITUDE_OF_1ST_STANDARD_PARALLEL(8823, "latitude of 1st standard parallel",
158-
UnitType.ANGLEUNIT),
159+
UnitType.ANGLEUNIT, "standard parallel 1"),
159160

160161
/**
161162
*
@@ -166,7 +167,7 @@ public enum MapProjectionParameters {
166167
* Scale is true along this parallel.
167168
*/
168169
LATITUDE_OF_2ND_STANDARD_PARALLEL(8824, "latitude of 2nd standard parallel",
169-
UnitType.ANGLEUNIT),
170+
UnitType.ANGLEUNIT, "standard parallel 2"),
170171

171172
/**
172173
* easting value assigned to the false origin

src/test/java/mil/nga/proj/ProjectionFactoryEpsgTest.java

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,76 @@ public void test3857() {
253253

254254
}
255255

256+
/**
257+
* Test EPSG 3978
258+
*/
259+
@Test
260+
public void test3978() {
261+
262+
final long code = 3978;
263+
264+
String definition = "PROJCRS[\"NAD83 / Canada Atlas Lambert\",BASEGEOGCRS[\"NAD83\","
265+
+ "DATUM[\"North American Datum 1983\","
266+
+ "ELLIPSOID[\"GRS 1980\",6378137,298.257222101,ID[\"EPSG\",7019]],"
267+
+ "ID[\"EPSG\",6269]],ID[\"EPSG\",4269]],"
268+
+ "CONVERSION[\"Canada Atlas Lambert\",METHOD[\"Lambert Conic Conformal (2SP)\",ID[\"EPSG\",9802]],"
269+
+ "PARAMETER[\"Latitude of false origin\",49,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]],"
270+
+ "PARAMETER[\"Longitude of false origin\",-95,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]],"
271+
+ "PARAMETER[\"Latitude of 1st standard parallel\",49,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]],"
272+
+ "PARAMETER[\"Latitude of 2nd standard parallel\",77,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]],"
273+
+ "PARAMETER[\"Easting at false origin\",0,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]],"
274+
+ "PARAMETER[\"Northing at false origin\",0,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]],"
275+
+ "ID[\"EPSG\",3977]],CS[Cartesian,2,ID[\"EPSG\",4400]],"
276+
+ "AXIS[\"Easting (E)\",east],AXIS[\"Northing (N)\",north],"
277+
+ "LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]],ID[\"EPSG\",3978]]";
278+
279+
projectionTestDerived(code, definition);
280+
281+
definition = "PROJCS[\"NAD83 / Canada Atlas Lambert\",GEOGCS[\"NAD83\","
282+
+ "DATUM[\"North_American_Datum_1983\","
283+
+ "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],"
284+
+ "TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6269\"]],"
285+
+ "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"
286+
+ "UNIT[\"degree\",0.0174532925199433,"
287+
+ "AUTHORITY[\"EPSG\",\"9122\"]],"
288+
+ "AUTHORITY[\"EPSG\",\"4269\"]],"
289+
+ "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],"
290+
+ "PARAMETER[\"standard_parallel_1\",49],"
291+
+ "PARAMETER[\"standard_parallel_2\",77],"
292+
+ "PARAMETER[\"latitude_of_origin\",49],"
293+
+ "PARAMETER[\"central_meridian\",-95],"
294+
+ "PARAMETER[\"false_easting\",0],"
295+
+ "PARAMETER[\"false_northing\",0],"
296+
+ "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"
297+
+ "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],"
298+
+ "AUTHORITY[\"EPSG\",\"3978\"]]";
299+
300+
projectionTestDerived(code, definition);
301+
302+
definition = "PROJCS[\"NAD83 / Canada Atlas Lambert\",GEOGCRS[\"NAD83\","
303+
+ "DATUM[\"North_American_Datum_1983\","
304+
+ "SPHEROID[\"GRS 1980\",6378137,298.257222101,"
305+
+ "ID[\"EPSG\",\"7019\"]],"
306+
+ "ABRIDGEDTRANSFORMATION[0,0,0,0,0,0,0],"
307+
+ "ID[\"EPSG\",\"6269\"]],"
308+
+ "PRIMEM[\"Greenwich\",0,ID[\"EPSG\",\"8901\"]],"
309+
+ "UNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",\"9122\"]],"
310+
+ "ID[\"EPSG\",\"4269\"]],"
311+
+ "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],"
312+
+ "PARAMETER[\"standard_parallel_1\",49],"
313+
+ "PARAMETER[\"standard_parallel_2\",77],"
314+
+ "PARAMETER[\"latitude_of_origin\",49],"
315+
+ "PARAMETER[\"central_meridian\",-95],"
316+
+ "PARAMETER[\"false_easting\",0],"
317+
+ "PARAMETER[\"false_northing\",0],"
318+
+ "UNIT[\"metre\",1,ID[\"EPSG\",\"9001\"]],"
319+
+ "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],"
320+
+ "ID[\"EPSG\",\"3978\"]]";
321+
322+
projectionTestDerived(code, definition);
323+
324+
}
325+
256326
/**
257327
* Test EPSG 4326
258328
*/

0 commit comments

Comments
 (0)