Skip to content

Commit 9d2b337

Browse files
committed
parser test
1 parent ac32e39 commit 9d2b337

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

src/test/java/mil/nga/crs/util/proj/ProjParserTest.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,56 @@ public void test2036() throws IOException {
6666

6767
}
6868

69+
/**
70+
* Test EPSG 2046
71+
*
72+
* @throws IOException
73+
* upon error
74+
*/
75+
@Test
76+
public void test2046() throws IOException {
77+
78+
// +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=0 +y_0=0 +axis=wsu
79+
// +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
80+
81+
String definition = "PROJCRS[\"Hartebeesthoek94 / Lo15\",BASEGEOGCRS[\"Hartebeesthoek94\","
82+
+ "DATUM[\"Hartebeesthoek94\","
83+
+ "ELLIPSOID[\"WGS 84\",6378137,298.2572236,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]],ID[\"EPSG\",7030]],"
84+
+ "ID[\"EPSG\",6148]],ID[\"EPSG\",4148]],"
85+
+ "CONVERSION[\"South African Survey Grid zone 15\",METHOD[\"Transverse Mercator (South Orientated)\",ID[\"EPSG\",9808]],"
86+
+ "PARAMETER[\"Latitude of natural origin\",0,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]],"
87+
+ "PARAMETER[\"Longitude of natural origin\",15,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]],"
88+
+ "PARAMETER[\"Scale factor at natural origin\",1,SCALEUNIT[\"unity\",1,ID[\"EPSG\",9201]]],"
89+
+ "PARAMETER[\"False easting\",0,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]],"
90+
+ "PARAMETER[\"False northing\",0,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]],"
91+
+ "ID[\"EPSG\",17515]],"
92+
+ "CS[Cartesian,2,ID[\"EPSG\",6503]],AXIS[\"Westing (Y)\",west],AXIS[\"Southing (X)\",south],"
93+
+ "LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]],ID[\"EPSG\",2046]]";
94+
95+
String expected = "+proj=tmerc +lat_0=0 +lon_0=15 +k_0=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +units=m +no_defs";
96+
assertEquals(expected, ProjParser.paramsText(definition));
97+
98+
definition = "PROJCS[\"Hartebeesthoek94 / Lo15\","
99+
+ "GEOGCS[\"Hartebeesthoek94\"," + "DATUM[\"Hartebeesthoek94\","
100+
+ "SPHEROID[\"WGS 84\",6378137,298.257223563,"
101+
+ "AUTHORITY[\"EPSG\",\"7030\"]]," + "TOWGS84[0,0,0,0,0,0,0],"
102+
+ "AUTHORITY[\"EPSG\",\"6148\"]]," + "PRIMEM[\"Greenwich\",0,"
103+
+ "AUTHORITY[\"EPSG\",\"8901\"]],"
104+
+ "UNIT[\"degree\",0.0174532925199433,"
105+
+ "AUTHORITY[\"EPSG\",\"9122\"]],"
106+
+ "AUTHORITY[\"EPSG\",\"4148\"]],"
107+
+ "PROJECTION[\"Transverse_Mercator_South_Orientated\"],"
108+
+ "PARAMETER[\"latitude_of_origin\",0],"
109+
+ "PARAMETER[\"central_meridian\",15],"
110+
+ "PARAMETER[\"scale_factor\",1],"
111+
+ "PARAMETER[\"false_easting\",0],"
112+
+ "PARAMETER[\"false_northing\",0]," + "UNIT[\"metre\",1,"
113+
+ "AUTHORITY[\"EPSG\",\"9001\"]]," + "AXIS[\"Y\",WEST],"
114+
+ "AXIS[\"X\",SOUTH]," + "AUTHORITY[\"EPSG\",\"2046\"]]";
115+
116+
expected = "+proj=tmerc +lat_0=0 +lon_0=15 +k_0=1 +x_0=0 +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs";
117+
assertEquals(expected, ProjParser.paramsText(definition));
118+
119+
}
120+
69121
}

0 commit comments

Comments
 (0)