Changeset 12163 in josm
- Timestamp:
- 2017-05-15T15:57:36+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r12161 r12163 282 282 case DEGREES_MINUTES_SECONDS: return dms(y) + ((y < 0) ? SOUTH : NORTH); 283 283 case NAUTICAL: return dm(y) + ((y < 0) ? SOUTH : NORTH); 284 case EAST_NORTH: return cDdFormatter.format( Main.getProjection().latlon2eastNorth(this).north());284 case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().north()); 285 285 default: return "ERR"; 286 286 } … … 302 302 case DEGREES_MINUTES_SECONDS: return dms(x) + ((x < 0) ? WEST : EAST); 303 303 case NAUTICAL: return dm(x) + ((x < 0) ? WEST : EAST); 304 case EAST_NORTH: return cDdFormatter.format( Main.getProjection().latlon2eastNorth(this).east());304 case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().east()); 305 305 default: return "ERR"; 306 306 } -
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r12139 r12163 118 118 LatLon center = getCenter(); 119 119 Projection offsetProj = Projections.getProjectionByCode(projection_code); 120 EastNorth centerEN = offsetProj.latlon2eastNorth(center);120 EastNorth centerEN = center.getEastNorth(offsetProj); 121 121 EastNorth shiftedEN = centerEN.add(getDisplacement()); 122 122 LatLon shifted = offsetProj.eastNorth2latlon(shiftedEN); 123 EastNorth centerEN2 = proj.latlon2eastNorth(center);124 EastNorth shiftedEN2 = proj.latlon2eastNorth(shifted);123 EastNorth centerEN2 = center.getEastNorth(proj); 124 EastNorth shiftedEN2 = shifted.getEastNorth(proj); 125 125 return shiftedEN2.subtract(centerEN2); 126 126 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r10806 r12163 7 7 import org.openstreetmap.josm.data.Bounds; 8 8 import org.openstreetmap.josm.data.ProjectionBounds; 9 import org.openstreetmap.josm.data.coor.CachedLatLon;10 9 import org.openstreetmap.josm.data.coor.EastNorth; 10 import org.openstreetmap.josm.data.coor.ILatLon; 11 11 import org.openstreetmap.josm.data.coor.LatLon; 12 12 import org.openstreetmap.josm.data.osm.Node; … … 27 27 @Override 28 28 public void visit(Node n) { 29 visit( n.getEastNorth());29 visit((ILatLon) n); 30 30 } 31 31 … … 75 75 public void visit(LatLon latlon) { 76 76 if (latlon != null) { 77 if (latlon instanceof CachedLatLon) {78 visit(((CachedLatLon) latlon).getEastNorth());79 } else {80 visit(Main.getProjection().latlon2eastNorth(latlon)); 81 }82 }77 visit((ILatLon) latlon); 78 } 79 } 80 81 private void visit(ILatLon latlon) { 82 visit(latlon.getEastNorth()); 83 83 } 84 84 … … 134 134 LatLon minLatlon = Main.getProjection().eastNorth2latlon(bounds.getMin()); 135 135 LatLon maxLatlon = Main.getProjection().eastNorth2latlon(bounds.getMax()); 136 bounds = new ProjectionBounds( 137 Main.getProjection().latlon2eastNorth(new LatLon( 136 bounds = new ProjectionBounds(new LatLon( 138 137 Math.max(-90, minLatlon.lat() - enlargeDegree), 139 Math.max(-180, minLatlon.lon() - enlargeDegree)) ),140 Main.getProjection().latlon2eastNorth(new LatLon(138 Math.max(-180, minLatlon.lon() - enlargeDegree)).getEastNorth(), 139 new LatLon( 141 140 Math.min(90, maxLatlon.lat() + enlargeDegree), 142 Math.min(180, maxLatlon.lon() + enlargeDegree)) ));141 Math.min(180, maxLatlon.lon() + enlargeDegree)).getEastNorth()); 143 142 } 144 143 -
trunk/src/org/openstreetmap/josm/data/projection/Projecting.java
r12162 r12163 25 25 * @param ll the geographical point to convert (in WGS84 lat/lon) 26 26 * @return the corresponding east/north coordinates 27 * @see ILatLon#getEastNorth(Projecting) 27 28 */ 28 29 default EastNorth latlon2eastNorth(LatLon ll) { … … 36 37 * @return the corresponding east/north coordinates 37 38 * @since 12161 39 * @see ILatLon#getEastNorth(Projecting) 38 40 */ 39 41 EastNorth latlon2eastNorth(ILatLon ll); -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r12119 r12163 37 37 import org.openstreetmap.josm.data.SystemOfMeasurement; 38 38 import org.openstreetmap.josm.data.ViewportData; 39 import org.openstreetmap.josm.data.coor.CachedLatLon;40 39 import org.openstreetmap.josm.data.coor.EastNorth; 40 import org.openstreetmap.josm.data.coor.ILatLon; 41 41 import org.openstreetmap.josm.data.coor.LatLon; 42 42 import org.openstreetmap.josm.data.osm.BBox; … … 510 510 /** 511 511 * Return the point on the screen where this Coordinate would be. 512 * 513 * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)} 512 514 * @param latlon The point, where this geopoint would be drawn. 513 515 * @return The point on screen where "point" would be drawn, relative to the own top/left. 514 516 */ 515 517 public Point2D getPoint2D(LatLon latlon) { 516 if (latlon == null) 518 if (latlon == null) { 517 519 return new Point(); 518 else if (latlon instanceof CachedLatLon) 519 return getPoint2D(((CachedLatLon) latlon).getEastNorth()); 520 else 521 return getPoint2D(getProjection().latlon2eastNorth(latlon)); 520 } else { 521 return getPoint2D(latlon.getEastNorth()); 522 } 522 523 } 523 524 524 525 /** 525 526 * Return the point on the screen where this Node would be. 527 * 528 * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)} 526 529 * @param n The node, where this geopoint would be drawn. 527 530 * @return The point on screen where "node" would be drawn, relative to the own top/left.
Note:
See TracChangeset
for help on using the changeset viewer.