- Timestamp:
- 2012-05-13T11:29:01+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/projection
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
r5073 r5237 2 2 package org.openstreetmap.josm.data.projection; 3 3 4 import org.openstreetmap.josm.data.coor.EastNorth; 5 import org.openstreetmap.josm.data.coor.LatLon; 4 6 import org.openstreetmap.josm.data.projection.datum.Datum; 5 7 import org.openstreetmap.josm.data.projection.proj.Proj; 6 import org.openstreetmap.josm.data.coor.EastNorth;7 import org.openstreetmap.josm.data.coor.LatLon;8 8 9 9 /** -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r5235 r5237 21 21 import org.openstreetmap.josm.data.projection.datum.NTV2Datum; 22 22 import org.openstreetmap.josm.data.projection.datum.NTV2GridShiftFileWrapper; 23 import org.openstreetmap.josm.data.projection.datum.NullDatum; 23 24 import org.openstreetmap.josm.data.projection.datum.SevenParameterDatum; 24 25 import org.openstreetmap.josm.data.projection.datum.ThreeParameterDatum; … … 246 247 String nadgridsId = parameters.get(Param.nadgrids.key); 247 248 if (nadgridsId != null) { 249 if (nadgridsId.startsWith("@")) { 250 nadgridsId = nadgridsId.substring(1); 251 } 252 if (nadgridsId.equals("null")) 253 return new NullDatum(null, ellps); 248 254 NTV2GridShiftFileWrapper nadgrids = Projections.getNTV2Grid(nadgridsId); 249 255 if (nadgrids == null) … … 280 286 } 281 287 } 288 boolean isCentric = true; 289 for (int i = 0; i<towgs84Param.size(); i++) { 290 if (towgs84Param.get(i) != 0.0) { 291 isCentric = false; 292 break; 293 } 294 } 295 if (isCentric) 296 return new CentricDatum(null, null, ellps); 282 297 boolean is3Param = true; 283 298 for (int i = 3; i<towgs84Param.size(); i++) { … … 287 302 } 288 303 } 289 Datum datum = null; 290 if (is3Param) { 291 datum = new ThreeParameterDatum(null, null, ellps, 304 if (is3Param) 305 return new ThreeParameterDatum(null, null, ellps, 292 306 towgs84Param.get(0), 293 307 towgs84Param.get(1), 294 towgs84Param.get(2) 295 ); 296 } else { 297 datum = new SevenParameterDatum(null, null, ellps, 308 towgs84Param.get(2)); 309 else 310 return new SevenParameterDatum(null, null, ellps, 298 311 towgs84Param.get(0), 299 312 towgs84Param.get(1), … … 302 315 towgs84Param.get(4), 303 316 towgs84Param.get(5), 304 towgs84Param.get(6) 305 ); 306 } 307 return datum; 317 towgs84Param.get(6)); 308 318 } 309 319 -
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r5234 r5237 123 123 while ((line = r.readLine()) != null) { 124 124 line = line.trim(); 125 if (!line.startsWith("#") ) {125 if (!line.startsWith("#") && !line.isEmpty()) { 126 126 Matcher m = epsgPattern.matcher(line); 127 127 if (m.matches()) { -
trunk/src/org/openstreetmap/josm/data/projection/datum/GRS80Datum.java
r4869 r5237 11 11 * is necessary to get from or to the WGS84 datum. 12 12 */ 13 public class GRS80Datum extends AbstractDatum {13 public class GRS80Datum extends NullDatum { 14 14 15 15 public final static GRS80Datum INSTANCE = new GRS80Datum(); 16 16 17 17 private GRS80Datum() { 18 super(tr("GRS80"), null, Ellipsoid.GRS80); 19 } 20 21 @Override 22 public LatLon fromWGS84(LatLon ll) { 23 return ll; 24 } 25 26 @Override 27 public LatLon toWGS84(LatLon ll) { 28 return ll; 18 super(tr("GRS80"), Ellipsoid.GRS80); 29 19 } 30 20 } -
trunk/src/org/openstreetmap/josm/data/projection/datum/WGS84Datum.java
r4869 r5237 10 10 * WGS84 datum. Transformation from and to WGS84 datum is a no-op. 11 11 */ 12 public class WGS84Datum extends AbstractDatum {12 public class WGS84Datum extends NullDatum { 13 13 14 14 public static final WGS84Datum INSTANCE = new WGS84Datum(); 15 15 16 16 private WGS84Datum() { 17 super(tr("WGS84"), "WGS84", Ellipsoid.WGS84); 18 } 19 20 @Override 21 public LatLon fromWGS84(LatLon ll) { 22 return ll; 23 } 24 25 @Override 26 public LatLon toWGS84(LatLon ll) { 27 return ll; 17 super(tr("WGS84"), Ellipsoid.WGS84); 28 18 } 29 19 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/Mercator.java
r5228 r5237 20 20 @Override 21 21 public String getProj4Id() { 22 return null; // "merc" is ellipsoidal Mercator projection in PROJ.422 return "josm:smerc"; // "merc" is ellipsoidal Mercator projection in PROJ.4 23 23 } 24 24
Note:
See TracChangeset
for help on using the changeset viewer.