source: josm/src/org/openstreetmap/josm/data/osm/Node.java@ 203

Last change on this file since 203 was 203, checked in by imi, 17 years ago
  • Fixed a bug in the Merger/Conflict to auto-resolve marked changes without real changes
  • Fixed bug in split way, that reversed the order of segments in one way.
  • Fixed bug where dialogs did not update anymore after loading a dataset twice
File size: 1.3 KB
Line 
1package org.openstreetmap.josm.data.osm;
2
3import org.openstreetmap.josm.Main;
4import org.openstreetmap.josm.data.coor.LatLon;
5import org.openstreetmap.josm.data.coor.EastNorth;
6import org.openstreetmap.josm.data.osm.visitor.Visitor;
7
8
9/**
10 * One node data, consisting of one world coordinate waypoint.
11 *
12 * @author imi
13 */
14public class Node extends OsmPrimitive {
15
16 public LatLon coor;
17 public volatile EastNorth eastNorth;
18
19 /**
20 * Create an identical clone of the argument (including the id)
21 */
22 public Node(Node clone) {
23 cloneFrom(clone);
24 }
25
26 public Node(LatLon latlon) {
27 this.coor = latlon;
28 eastNorth = Main.proj.latlon2eastNorth(latlon);
29 }
30
31 @Override public void visit(Visitor visitor) {
32 visitor.visit(this);
33 }
34
35 @Override public void cloneFrom(OsmPrimitive osm) {
36 super.cloneFrom(osm);
37 coor = ((Node)osm).coor;
38 eastNorth = ((Node)osm).eastNorth;
39 }
40
41 @Override public String toString() {
42 return "{Node id="+id+",lat="+coor.lat()+",lon="+coor.lon()+"}";
43 }
44
45 @Override public boolean realEqual(OsmPrimitive osm, boolean semanticOnly) {
46 return osm instanceof Node ? super.realEqual(osm, semanticOnly) && coor.equals(((Node)osm).coor) : false;
47 }
48
49 public int compareTo(OsmPrimitive o) {
50 return o instanceof Node ? Long.valueOf(id).compareTo(o.id) : 1;
51 }
52}
Note: See TracBrowser for help on using the repository browser.