|
16 | 16 | */ |
17 | 17 | public class CRSReaderWriterEpsgTest { |
18 | 18 |
|
| 19 | + /** |
| 20 | + * Test EPSG 2057 |
| 21 | + * |
| 22 | + * @throws IOException |
| 23 | + * upon error |
| 24 | + */ |
| 25 | + @Test |
| 26 | + public void test2057() throws IOException { |
| 27 | + |
| 28 | + String text = "PROJCRS[\"Rassadiran / Nakhl e Taqi\",BASEGEOGCRS[\"Rassadiran\"," |
| 29 | + + "DATUM[\"Rassadiran\",ELLIPSOID[\"International 1924\",6378388,297,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]," |
| 30 | + + "ID[\"EPSG\",7022]],ID[\"EPSG\",6153]],ID[\"EPSG\",4153]]," |
| 31 | + + "CONVERSION[\"Nakhl e Taqi Oblique Mercator\",METHOD[\"Hotine Oblique Mercator (variant B)\",ID[\"EPSG\",9815]]," |
| 32 | + + "PARAMETER[\"Latitude of projection centre\",27.518828806,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," |
| 33 | + + "PARAMETER[\"Longitude of projection centre\",52.603539167,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," |
| 34 | + + "PARAMETER[\"Azimuth of initial line\",0.571661194,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," |
| 35 | + + "PARAMETER[\"Angle from Rectified to Skew Grid\",0.571661194,ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]]]," |
| 36 | + + "PARAMETER[\"Scale factor on initial line\",0.999895934,SCALEUNIT[\"unity\",1,ID[\"EPSG\",9201]]]," |
| 37 | + + "PARAMETER[\"Easting at projection centre\",658377.437,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]," |
| 38 | + + "PARAMETER[\"Northing at projection centre\",3044969.194,LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]]]," |
| 39 | + + "ID[\"EPSG\",19951]],CS[Cartesian,2,ID[\"EPSG\",4400]]," |
| 40 | + + "AXIS[\"Easting (E)\",east],AXIS[\"Northing (N)\",north]," |
| 41 | + + "LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]],ID[\"EPSG\",2057]]"; |
| 42 | + |
| 43 | + CRS crs = CRSReader.read(text, true); |
| 44 | + |
| 45 | + String expectedText = text.replace("6378388", "6378388.0") |
| 46 | + .replace("297", "297.0").replace(",1,", ",1.0,"); |
| 47 | + |
| 48 | + assertEquals(expectedText, crs.toString()); |
| 49 | + assertEquals(expectedText, CRSWriter.write(crs)); |
| 50 | + assertEquals(WKTUtils.pretty(expectedText), CRSWriter.writePretty(crs)); |
| 51 | + |
| 52 | + text = "PROJCS[\"Rassadiran / Nakhl e Taqi\",GEOGCS[\"Rassadiran\"," |
| 53 | + + "DATUM[\"Rassadiran\",SPHEROID[\"International 1924\",6378388,297," |
| 54 | + + "AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-133.63,-157.5,-158.62,0,0,0,0],AUTHORITY[\"EPSG\",\"6153\"]]," |
| 55 | + + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]," |
| 56 | + + "AUTHORITY[\"EPSG\",\"4153\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," |
| 57 | + + "PROJECTION[\"Hotine_Oblique_Mercator\"]," |
| 58 | + + "PARAMETER[\"latitude_of_center\",27.51882880555555]," |
| 59 | + + "PARAMETER[\"longitude_of_center\",52.60353916666667]," |
| 60 | + + "PARAMETER[\"azimuth\",0.5716611944444444]," |
| 61 | + + "PARAMETER[\"rectified_grid_angle\",0.5716611944444444]," |
| 62 | + + "PARAMETER[\"scale_factor\",0.999895934]," |
| 63 | + + "PARAMETER[\"false_easting\",658377.437]," |
| 64 | + + "PARAMETER[\"false_northing\",3044969.194],AUTHORITY[\"EPSG\",\"2057\"]," |
| 65 | + + "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"; |
| 66 | + |
| 67 | + crs = CRSReader.read(text, true); |
| 68 | + |
| 69 | + expectedText = "PROJCRS[\"Rassadiran / Nakhl e Taqi\",BASEGEOGCRS[\"Rassadiran\"," |
| 70 | + + "DATUM[\"Rassadiran\",ELLIPSOID[\"International 1924\",6378388.0,297.0," |
| 71 | + + "ID[\"EPSG\",7022]],ID[\"EPSG\",6153]]," |
| 72 | + + "PRIMEM[\"Greenwich\",0.0,ID[\"EPSG\",8901]],UNIT[\"degree\",0.01745329251994328,ID[\"EPSG\",9122]],ID[\"EPSG\",4153]]," |
| 73 | + + "CONVERSION[\"Rassadiran / Nakhl e Taqi / Hotine_Oblique_Mercator\",METHOD[\"Hotine_Oblique_Mercator\"]," |
| 74 | + + "PARAMETER[\"latitude_of_center\",27.51882880555555]," |
| 75 | + + "PARAMETER[\"longitude_of_center\",52.60353916666667]," |
| 76 | + + "PARAMETER[\"azimuth\",0.5716611944444444]," |
| 77 | + + "PARAMETER[\"rectified_grid_angle\",0.5716611944444444]," |
| 78 | + + "PARAMETER[\"scale_factor\",0.999895934]," |
| 79 | + + "PARAMETER[\"false_easting\",658377.437]," |
| 80 | + + "PARAMETER[\"false_northing\",3044969.194]," |
| 81 | + + "PARAMETER[\"X-axis translation\",-133.63,LENGTHUNIT[\"metre\",1.0]]," |
| 82 | + + "PARAMETER[\"Y-axis translation\",-157.5,LENGTHUNIT[\"metre\",1.0]]," |
| 83 | + + "PARAMETER[\"Z-axis translation\",-158.62,LENGTHUNIT[\"metre\",1.0]]]," |
| 84 | + + "CS[ellipsoidal,2],AXIS[\"Easting\",east],AXIS[\"Northing\",north]," |
| 85 | + + "UNIT[\"metre\",1.0,ID[\"EPSG\",9001]],ID[\"EPSG\",2057]]"; |
| 86 | + |
| 87 | + assertEquals(expectedText, crs.toString()); |
| 88 | + assertEquals(expectedText, CRSWriter.write(crs)); |
| 89 | + assertEquals(WKTUtils.pretty(expectedText), CRSWriter.writePretty(crs)); |
| 90 | + |
| 91 | + } |
| 92 | + |
19 | 93 | /** |
20 | 94 | * Test EPSG 3035 |
21 | 95 | * |
|
0 commit comments