Changeset 14120 in josm for trunk/test/unit/org/openstreetmap/josm/data/projection
- Timestamp:
- 2018-08-11T17:29:48+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r13702 r14120 8 8 import org.junit.Rule; 9 9 import org.junit.Test; 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.data.coor.EastNorth; 12 11 import org.openstreetmap.josm.data.coor.LatLon; … … 34 33 @BeforeClass 35 34 public static void setUp() { 36 Main.setProjection(Projections.getProjectionByCode(SWISS_EPSG_CODE)); // Swiss grid35 ProjectionRegistry.setProjection(Projections.getProjectionByCode(SWISS_EPSG_CODE)); // Swiss grid 37 36 } 38 37 … … 97 96 public void testAlatlon2eastNorth() { 98 97 LatLon ll = new LatLon(46.518, 6.567); 99 EastNorth en = Main.getProjection().latlon2eastNorth(ll);98 EastNorth en = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 100 99 if (debug) { 101 100 System.out.println(en); … … 105 104 106 105 ll = new LatLon(47.78, 8.58); 107 en = Main.getProjection().latlon2eastNorth(ll);106 en = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 108 107 if (debug) { 109 108 System.out.println(en); … … 113 112 114 113 ll = new LatLon(46.58, 10.48); 115 en = Main.getProjection().latlon2eastNorth(ll);114 en = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 116 115 if (debug) { 117 116 System.out.println(en); … … 121 120 122 121 ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600); 123 en = Main.getProjection().latlon2eastNorth(ll);122 en = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 124 123 if (debug) { 125 124 System.out.println(en); … … 130 129 // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000 131 130 ll = new LatLon(46.04412093223244, 8.730497366167727); 132 en = Main.getProjection().latlon2eastNorth(ll);131 en = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 133 132 if (debug) { 134 133 System.out.println(en); … … 144 143 public void testBeastNorth2latlon() { 145 144 EastNorth en = new EastNorth(533112.13, 152227.35); 146 LatLon ll = Main.getProjection().eastNorth2latlon(en);145 LatLon ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 147 146 if (debug) { 148 147 System.out.println(ll); … … 152 151 153 152 en = new EastNorth(685542.97, 292783.21); 154 ll = Main.getProjection().eastNorth2latlon(en);153 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 155 154 if (debug) { 156 155 System.out.println(ll); … … 160 159 161 160 en = new EastNorth(833066.95, 163265.32); 162 ll = Main.getProjection().eastNorth2latlon(en);161 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 163 162 if (debug) { 164 163 System.out.println(ll); … … 168 167 169 168 en = new EastNorth(600000.0, 200000.0); 170 ll = Main.getProjection().eastNorth2latlon(en);169 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 171 170 if (debug) { 172 171 System.out.println(ll); … … 177 176 // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000 178 177 en = new EastNorth(700000.0, 100000.0); 179 ll = Main.getProjection().eastNorth2latlon(en);178 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 180 179 if (debug) { 181 180 System.out.println(ll); … … 191 190 public void testCsendandreturn() { 192 191 EastNorth en = new EastNorth(533111.69, 152227.85); 193 LatLon ll = Main.getProjection().eastNorth2latlon(en);194 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll);192 LatLon ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 193 EastNorth en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 195 194 if (debug) { 196 195 System.out.println(en.east() - en2.east()); … … 203 202 204 203 en = new EastNorth(685544.16, 292782.91); 205 ll = Main.getProjection().eastNorth2latlon(en);206 en2 = Main.getProjection().latlon2eastNorth(ll);204 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 205 en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 207 206 if (debug) { 208 207 System.out.println(en.east() - en2.east()); … … 215 214 216 215 en = new EastNorth(833068.04, 163265.39); 217 ll = Main.getProjection().eastNorth2latlon(en);218 en2 = Main.getProjection().latlon2eastNorth(ll);216 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 217 en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 219 218 if (debug) { 220 219 System.out.println(en.east() - en2.east()); … … 227 226 228 227 en = new EastNorth(600000.0, 200000.0); 229 ll = Main.getProjection().eastNorth2latlon(en);230 en2 = Main.getProjection().latlon2eastNorth(ll);228 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 229 en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 231 230 if (debug) { 232 231 System.out.println(en.east() - en2.east()); … … 239 238 240 239 en = new EastNorth(700000.0, 100000.0); 241 ll = Main.getProjection().eastNorth2latlon(en);242 en2 = Main.getProjection().latlon2eastNorth(ll);240 ll = ProjectionRegistry.getProjection().eastNorth2latlon(en); 241 en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll); 243 242 if (debug) { 244 243 System.out.println(en.east() - en2.east());
Note:
See TracChangeset
for help on using the changeset viewer.