Changeset 40 in josm for src/org/openstreetmap/josm/data
- Timestamp:
- 2006-01-11T23:39:36+01:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm/data
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/data/Bounds.java
r23 r40 1 1 package org.openstreetmap.josm.data; 2 3 import org.openstreetmap.josm.Main; 4 import org.openstreetmap.josm.data.projection.Projection; 2 5 3 6 /** … … 45 48 this.max = max; 46 49 } 47 50 51 /** 52 * Construct bounds that span the whole world. 53 */ 54 public Bounds() { 55 min = new GeoPoint(-Projection.MAX_LAT, -Projection.MAX_LON); 56 Main.pref.getProjection().latlon2xy(min); 57 max = new GeoPoint(Projection.MAX_LAT, Projection.MAX_LON); 58 Main.pref.getProjection().latlon2xy(max); 59 } 60 48 61 /** 49 62 * @return The bounding rectangle that covers <code>this</code> and … … 59 72 return new Bounds(nmin, nmax); 60 73 } 61 74 62 75 /** 63 76 * @return The bounding rectangle that covers <code>this</code> and -
src/org/openstreetmap/josm/data/GeoPoint.java
r18 r40 1 1 package org.openstreetmap.josm.data; 2 3 import org.openstreetmap.josm.data.projection.Projection; 2 4 3 5 … … 66 68 !Double.isNaN(lat) && !Double.isNaN(lon); 67 69 } 70 71 /** 72 * @return <code>true</code>, if the coordinate is outside the world, compared 73 * by using lat/lon. 74 */ 75 public boolean isOutSideWorld() { 76 return lat < -Projection.MAX_LAT || lat > Projection.MAX_LAT || 77 lon < -Projection.MAX_LON || lon > Projection.MAX_LON; 78 } 68 79 } -
src/org/openstreetmap/josm/data/osm/DataSet.java
r35 r40 50 50 o.addAll(lineSegments); 51 51 o.addAll(tracks); 52 return o; 53 } 54 55 /** 56 * @return A collection containing all not-deleted primitives (except keys). 57 */ 58 public Collection<OsmPrimitive> allNonDeletedPrimitives() { 59 Collection<OsmPrimitive> o = new LinkedList<OsmPrimitive>(); 60 for (OsmPrimitive osm : allPrimitives()) 61 if (!osm.isDeleted()) 62 o.add(osm); 52 63 return o; 53 64 } -
src/org/openstreetmap/josm/data/osm/visitor/AddVisitor.java
r35 r40 26 26 public void visit(Node n) { 27 27 ds.nodes.add(n); 28 n.setDeleted(false);29 28 } 30 29 public void visit(LineSegment ls) { 31 30 ds.lineSegments.add(ls); 32 ls.setDeleted(false);33 31 } 34 32 public void visit(Track t) { 35 33 ds.tracks.add(t); 36 t.setDeleted(false);37 34 } 38 35 public void visit(Key k) {} -
src/org/openstreetmap/josm/data/osm/visitor/CollectBackReferencesVisitor.java
r31 r40 14 14 * Helper that collect all line segments a node is part of, all tracks 15 15 * a node or line segment is part of and all areas a node is part of. 16 * 17 * Deleted objects are not collected. 18 * 16 19 * @author imi 17 20 */ … … 25 28 public final Collection<OsmPrimitive> data = new HashSet<OsmPrimitive>(); 26 29 30 31 /** 32 * Construct a back reference counter. 33 * @param ds The dataset to operate on. 34 */ 27 35 public CollectBackReferencesVisitor(DataSet ds) { 28 36 this.ds = ds; … … 31 39 public void visit(Node n) { 32 40 for (Track t : ds.tracks) { 41 if (t.isDeleted()) 42 continue; 33 43 for (LineSegment ls : t.segments) { 34 44 if (ls.start == n || ls.end == n) { … … 38 48 } 39 49 } 40 for (LineSegment ls : ds.lineSegments) 50 for (LineSegment ls : ds.lineSegments) { 51 if (ls.isDeleted()) 52 continue; 41 53 if (ls.start == n || ls.end == n) 42 54 data.add(ls); 55 } 43 56 } 44 57 public void visit(LineSegment ls) { 45 for (Track t : ds.tracks) 58 for (Track t : ds.tracks) { 59 if (t.isDeleted()) 60 continue; 46 61 if (t.segments.contains(ls)) 47 62 data.add(t); 63 } 48 64 } 49 65 public void visit(Track t) {} -
src/org/openstreetmap/josm/data/projection/Projection.java
r23 r40 18 18 */ 19 19 abstract public class Projection implements Cloneable { 20 21 public static double MAX_LAT = 85; // yep - JOSM cannot cartograph the poles. 22 public static double MAX_LON = 179.99999; 20 23 21 24 /** -
src/org/openstreetmap/josm/data/projection/UTM.java
r35 r40 195 195 ZoneData autoDetect(Bounds b) { 196 196 ZoneData zd = new ZoneData(); 197 if (b == null)198 return zd;199 197 GeoPoint center = b.centerLatLon(); 200 198 double lat = center.lat;
Note:
See TracChangeset
for help on using the changeset viewer.