Examples of allPrimitives()


Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

                    synchronized(this) {
                        reader = null;
                    }
                    checked.add(current);
                    getProgressMonitor().subTask(tr("Checking for deleted parents in the local dataset"));
                    for (OsmPrimitive p: ds.allPrimitives()) {
                        if (canceled) return;
                        OsmPrimitive myDeletedParent = layer.data.getPrimitiveById(p);
                        // our local dataset includes a deleted parent of a primitive we want
                        // to delete. Include this parent in the collection of uploaded primitives
                        //
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

            });
        } else if (args.containsKey("search") && PermissionPrefWithDefault.CHANGE_SELECTION.isAllowed()) {
            try {
                final DataSet ds = Main.main.getCurrentDataSet();
                final SearchCompiler.Match search = SearchCompiler.compile(args.get("search"), false, false);
                final Collection<OsmPrimitive> filteredPrimitives = Utils.filter(ds.allPrimitives(), search);
                ds.setSelected(filteredPrimitives);
                zoom(filteredPrimitives, bbox);
            } catch (SearchCompiler.ParseError ex) {
                Main.error(ex);
                throw new RequestHandlerErrorException(ex);
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

        HashSet<OsmPrimitive> ret = new HashSet<>();
        for (DownloadTask task : tasks) {
            if (task instanceof DownloadOsmTask) {
                DataSet ds = ((DownloadOsmTask) task).getDownloadedData();
                if (ds != null) {
                    ret.addAll(ds.allPrimitives());
                }
            }
        }
        return ret;
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

                for (DownloadTask task : tasks) {
                    if (task instanceof DownloadOsmTask) {
                        DataSet ds = ((DownloadOsmTask) task).getDownloadedData();
                        if (ds != null) {
                            // myPrimitives.removeAll(ds.allPrimitives()) will do the same job but much slower
                            for (OsmPrimitive primitive: ds.allPrimitives()) {
                                myPrimitives.remove(primitive);
                            }
                        }
                    }
                }
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

    }

    public void clearFilterFlags() {
        DataSet ds = Main.main.getCurrentDataSet();
        if (ds != null) {
            FilterWorker.clearFilterFlags(ds.allPrimitives());
        }
        disabledCount = 0;
        disabledAndHiddenCount = 0;
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

    @Test
    public void testTicket6313() throws Exception {
        try (InputStream fis = new FileInputStream("data_nodist/UnconnectedWaysTest.osm")) {
            final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
            bib.visit(ds.allPrimitives());
            bib.endTest();
            assertThat(bib.getErrors(), isEmpty());
        }
    }
}
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

        ds.addPrimitive(a);
        ds.addPrimitive(b);

        DuplicateNode test = new DuplicateNode();
        test.startTest(NullProgressMonitor.INSTANCE);
        test.visit(ds.allPrimitives());
        test.endTest();

        assertEquals(1, test.getErrors().size());
    }
}
View Full Code Here

Examples of org.openstreetmap.josm.data.osm.DataSet.allPrimitives()

        DataSet newDataSet = builder.build();
        //restore selection
        sourceDataSet.setSelected(origSelection);

        List<PrimitiveData> newObjects = new ArrayList<PrimitiveData>();
        for (OsmPrimitive p : newDataSet.allPrimitives()) {
            newObjects.add(p.save());
        }
        return newObjects;
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.