Changeset 8357 in josm for trunk/src/org/openstreetmap/josm/data/coor
- Timestamp:
- 2015-05-15T23:49:31+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java
r8308 r8357 9 9 * 10 10 * This class is convenient to use, but has relatively high memory costs. 11 * It keeps a pointer to the last known projection in order to detect projection 12 * changes. 11 * It keeps a pointer to the last known projection in order to detect projection changes. 13 12 * 14 13 * Node and WayPoint have another, optimized, cache for projected coordinates. 15 14 */ 16 15 public class CachedLatLon extends LatLon { 16 17 private static final long serialVersionUID = 1L; 18 17 19 private EastNorth eastNorth; 18 20 private transient Projection proj; 19 21 22 /** 23 * Constructs a new {@code CachedLatLon}. 24 * @param lat latitude 25 * @param lon longitude 26 */ 20 27 public CachedLatLon(double lat, double lon) { 21 28 super(lat, lon); 22 29 } 23 30 31 /** 32 * Constructs a new {@code CachedLatLon}. 33 * @param coor lat/lon 34 */ 24 35 public CachedLatLon(LatLon coor) { 25 36 super(coor.lat(), coor.lon()); … … 27 38 } 28 39 40 /** 41 * Constructs a new {@code CachedLatLon}. 42 * @param eastNorth easting/northing 43 */ 29 44 public CachedLatLon(EastNorth eastNorth) { 30 45 super(Main.getProjection().eastNorth2latlon(eastNorth)); … … 39 54 */ 40 55 public final EastNorth getEastNorth() { 41 if(proj != Main.getProjection()) 42 { 56 if (proj != Main.getProjection()) { 43 57 proj = Main.getProjection(); 44 58 eastNorth = proj.latlon2eastNorth(this); … … 46 60 return eastNorth; 47 61 } 48 @Override public String toString() { 62 63 @Override 64 public String toString() { 49 65 return "CachedLatLon[lat="+lat()+",lon="+lon()+"]"; 50 66 } 51 52 // Only for Node.get3892DebugInfo()53 public Projection getProjection() {54 return proj;55 }56 67 }
Note:
See TracChangeset
for help on using the changeset viewer.