Changeset 18425 in osm for applications


Ignore:
Timestamp:
2009-11-02T21:06:59+01:00 (15 years ago)
Author:
jttt
Message:

Replace Dataset.nodes with getNodes(), etc

Location:
applications/editors/josm/plugins/validator
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/build.xml

    r18391 r18425  
    2626                <attribute name="Plugin-Description" value="An OSM data validator. It checks for problems in data, and provides fixes for the common ones. Spellcheck integrated for tag names."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Validator"/>
    28                 <attribute name="Plugin-Mainversion" value="2355"/>
     28                <attribute name="Plugin-Mainversion" value="2388"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java

    r18396 r18425  
    1010import java.util.Collection;
    1111import java.util.Collections;
    12 import java.util.List;
    1312import java.util.HashMap;
    1413import java.util.HashSet;
     14import java.util.List;
    1515import java.util.Map;
    1616import java.util.Set;
    1717
    1818import org.openstreetmap.josm.Main;
     19import org.openstreetmap.josm.data.coor.EastNorth;
    1920import org.openstreetmap.josm.data.coor.LatLon;
    20 import org.openstreetmap.josm.data.coor.EastNorth;
     21import org.openstreetmap.josm.data.osm.DataSet;
    2122import org.openstreetmap.josm.data.osm.Node;
    2223import org.openstreetmap.josm.data.osm.OsmUtils;
     24import org.openstreetmap.josm.data.osm.QuadBuckets;
    2325import org.openstreetmap.josm.data.osm.Way;
     26import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;
    2427import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    25 import org.openstreetmap.josm.data.osm.DataSet;
    26 import org.openstreetmap.josm.data.osm.QuadBuckets;
    2728import org.openstreetmap.josm.plugins.validator.PreferenceEditor;
    2829import org.openstreetmap.josm.plugins.validator.Severity;
     
    7475        this.ds = Main.main.getCurrentDataSet();
    7576        this.ds_area = ds.getDataSourceArea();
    76         // This is temporary until we get proper
    77         // reindexing in the dataset code.
    78         ArrayList<Node> ntmp = new ArrayList<Node>(ds.nodes);
    79         ds.nodes.clear();
    80         ds.nodes.addAll(ntmp);
    81         ArrayList<Way> wtmp = new ArrayList<Way>(ds.ways);
    82         ds.ways.clear();
    83         ds.ways.addAll(wtmp);
    84     }
     77        this.ds.reindexAll();
     78        }
    8579
    8680    @Override
     
    306300            // overlap a bit and can return duplicate nodes.
    307301            nearbyNodeCache = null;
    308             nodecache = ds.nodes;
    309302            List<LatLon> bounds = this.getBounds(dist);
    310             List<Node> found_nodes = nodecache.search(bounds.get(0), bounds.get(1));
     303            List<Node> found_nodes = ds.searchNodes(new BBox(bounds.get(0), bounds.get(1)));
    311304            if (found_nodes == null)
    312305                return Collections.emptySet();
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedNode.java

    r17722 r18425  
    5858                }
    5959            }
    60             for (Way w : Main.main.getCurrentDataSet().ways) {
     60            for (Way w : Main.main.getCurrentDataSet().getWays()) {
    6161                visit(w);
    6262            }
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedWay.java

    r18088 r18425  
    117117        super.startTest(monitor);
    118118        multipolygonways = new LinkedList<Way>();
    119         for (final Relation r : Main.main.getCurrentDataSet().relations)
     119        for (Relation r : Main.main.getCurrentDataSet().getRelations())
    120120        {
    121121            if(r.isUsable() && "multipolygon".equals(r.get("type")))
Note: See TracChangeset for help on using the changeset viewer.