Ignore:
Timestamp:
2008-01-30T18:02:38+01:00 (16 years ago)
Author:
gebner
Message:

Part one of patch by Dave Hansen <dave@…>

  • Remove unused imports
  • Main.debug
  • Make attribute merging aware of TIGER-import attributes
  • Better upload progress information
  • Retry uploads
Location:
trunk/src/org/openstreetmap/josm/data
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Bounds.java

    r298 r529  
    5959                        max = new LatLon(Math.max(ll.lat(), max.lat()), Math.max(ll.lon(), max.lon()));
    6060        }
     61        /**
     62         * Is the given point within this bounds?
     63         */
     64        public boolean contains(LatLon ll) {
     65                if (ll.lat() < min.lat() || ll.lon() < min.lon())
     66                        return false;
     67                if (ll.lat() > max.lat() || ll.lon() > max.lon())
     68                        return false;
     69                return true;
     70        }
    6171}
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r498 r529  
    44import java.text.ParseException;
    55import java.text.SimpleDateFormat;
    6 import java.util.ArrayList;
    76import java.util.Arrays;
    87import java.util.Collection;
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r357 r529  
    77
    88import org.openstreetmap.josm.data.osm.visitor.Visitor;
     9import org.openstreetmap.josm.tools.Pair;
    910
    1011/**
     
    1920         */
    2021        public final List<Node> nodes = new ArrayList<Node>();
     22
     23        public void visitNodes(Visitor v) {
     24                for (Node n : this.nodes)
     25                        v.visit(n);
     26        }
     27
     28        public ArrayList<Pair<Node,Node>> getNodePairs(boolean sort) {
     29                ArrayList<Pair<Node,Node>> chunkSet = new ArrayList<Pair<Node,Node>>();
     30                Node lastN = null;
     31                for (Node n : this.nodes) {
     32            if (lastN == null) {
     33                    lastN = n;
     34                        continue;
     35                    }
     36                        Pair<Node,Node> np = new Pair<Node,Node>(lastN, n);
     37                if (sort) {
     38                        Pair.sort(np);
     39                }
     40                chunkSet.add(np);
     41                lastN = n;
     42                }
     43                return chunkSet;
     44        }
     45
    2146
    2247        @Override public void visit(Visitor visitor) {
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/AllNodesVisitor.java

    r343 r529  
    3434         */
    3535        public void visit(Way w) {
    36                 for (Node n : w.nodes)
    37                         visit(n);
     36                w.visitNodes(this);
    3837        }
    3938
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java

    r343 r529  
    2323
    2424        public void visit(Way w) {
    25                 for (Node n : w.nodes)
    26                         visit(n);
     25                w.visitNodes(this);
    2726        }
    2827
Note: See TracChangeset for help on using the changeset viewer.