Package org.openstreetmap.josm.data.osm

Examples of org.openstreetmap.josm.data.osm.OsmPrimitive


        DataSet hull = builder.build();
        assertNotNull(hull);
        assertEquals(1, hull.getWays().size());
        assertEquals(2, hull.getNodes().size());

        OsmPrimitive p = hull.getPrimitiveById(1,OsmPrimitiveType.NODE);
        assertNotNull(p);
        assertEquals(p.getClass(), Node.class);

        p = hull.getPrimitiveById(2, OsmPrimitiveType.NODE);
        assertNotNull(p);
        assertEquals(p.getClass(), Node.class);

        p = hull.getPrimitiveById(3,OsmPrimitiveType.WAY);
        assertNotNull(p);
        assertEquals(p.getClass(), Way.class);
    }
View Full Code Here


        MergeSourceBuildingVisitor builder = new MergeSourceBuildingVisitor(source);
        DataSet hull = builder.build();
        assertNotNull(hull);
        assertEquals(1, hull.getWays().size());

        OsmPrimitive p = hull.getPrimitiveById(3, OsmPrimitiveType.WAY);
        assertNotNull(p);
        assertEquals(p.getClass(), Way.class);
        assertTrue(p.isIncomplete());
    }
View Full Code Here

        assertNotNull(hull);
        assertEquals(1, hull.getWays().size());
        assertEquals(3, hull.getNodes().size());
        assertEquals(2, hull.getRelations().size());

        OsmPrimitive p = hull.getPrimitiveById(1, OsmPrimitiveType.RELATION);
        assertNotNull(p);
        assertEquals(p.getClass(), Relation.class);

        Way w = (Way)hull.getPrimitiveById(30,OsmPrimitiveType.WAY);
        assertNotNull(w);
        assertEquals(2, w.getNodesCount());
        Node n = (Node)hull.getPrimitiveById(21, OsmPrimitiveType.NODE);
View Full Code Here

        assertNotNull(hull);
        assertEquals(1, hull.getWays().size());
        assertEquals(1, hull.getNodes().size());
        assertEquals(2, hull.getRelations().size());

        OsmPrimitive p = hull.getPrimitiveById(1, OsmPrimitiveType.RELATION);
        assertNotNull(p);
        assertEquals(p.getClass(), Relation.class);

        Way w = (Way)hull.getPrimitiveById(30, OsmPrimitiveType.WAY);
        assertNotNull(w);
        assertTrue(w.isIncomplete());
View Full Code Here

        assertNotNull(hull);
        assertEquals(1, hull.getWays().size());
        assertEquals(3, hull.getNodes().size());
        assertEquals(2, hull.getRelations().size());

        OsmPrimitive p = lookupByName(hull.getRelations(), "r1");
        assertNotNull(p);
        assertEquals(p.getClass(), Relation.class);

        Way w = (Way)lookupByName(hull.getWays(), "w30");
        assertNotNull(w);
        assertEquals(2, w.getNodesCount());
View Full Code Here

            if (matches.getSelected().contains(match)) {
                g2.setColor(Color.blue);
            } else {
                g2.setColor(Color.cyan);
            }
            OsmPrimitive reference = match.getReferenceObject();
            OsmPrimitive subject = match.getSubjectObject();
            if (reference != null && subject != null) {
                GeneralPath path = new GeneralPath();
                // we have a pair, so draw line between them
                Point p1 = mv.getPoint(ConflationUtils.getCenter(reference));
                Point p2 = mv.getPoint(ConflationUtils.getCenter(subject));
View Full Code Here

    @Override
    public void visitBoundingBox(BoundingXYVisitor v) {
        for (Iterator<SimpleMatch> it = this.matches.iterator(); it.hasNext();) {
            SimpleMatch match = it.next();
            OsmPrimitive reference = match.getReferenceObject();
            OsmPrimitive subject = match.getSubjectObject();
            if (reference != null && reference instanceof Node)
                v.visit((Node)reference);
            if (subject != null && subject instanceof Node)
                v.visit((Node)subject);
        }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.osm.OsmPrimitive

Copyright © 2018 www.massapicom. 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.