Package org.openstreetmap.josm.data.osm

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


            // This needs to be a hash set because the searches
            // overlap a bit and can return duplicate nodes.
            nearbyNodeCache = null;
            List<LatLon> bounds = this.getBounds(dist);
            List<Node> found_nodes = endnodes_highway.search(new BBox(bounds.get(0), bounds.get(1)));
            found_nodes.addAll(endnodes.search(new BBox(bounds.get(0), bounds.get(1))));

            for (Node n : found_nodes) {
                if (!nearby(n, dist) || !n.getCoor().isIn(dsArea)) {
                    continue;
                }
View Full Code Here


    public boolean hasZoomRedoEntries() {
        return !zoomRedoBuffer.isEmpty();
    }

    private BBox getBBox(Point p, int snapDistance) {
        return new BBox(getLatLon(p.x - snapDistance, p.y - snapDistance),
                getLatLon(p.x + snapDistance, p.y + snapDistance));
    }
View Full Code Here

        return intersectionNodes;
    }

    private static BBox getNodesBounds(List<Node> nodes) {

        BBox bounds = new BBox(nodes.get(0));
        for (Node n: nodes) {
            bounds.add(n.getCoor());
        }
        return bounds;
    }
View Full Code Here

    private final Set<SimplePrimitiveId> toSelect = new HashSet<>();

    @Override
    public String getPermissionMessage() {
        String msg = tr("Remote Control has been asked to load data from the API.") +
                "<br>" + tr("Bounding box: ") + new BBox(minlon, minlat, maxlon, maxlat).toStringCSV(", ");
        if (args.containsKey("select") && toSelect.size() > 0) {
            msg += "<br>" + tr("Selection: {0}", toSelect.size());
        }
        return msg;
    }
View Full Code Here

     * @param bounds display boundaries
     */
    @SuppressWarnings("unchecked")
    @Override
    public void render(DataSet data, boolean virtual, Bounds bounds) {
        BBox bbox = bounds.toBBox();
        this.ds = data;
        getSettings(virtual);

        for (final Relation rel : data.searchRelations(bbox)) {
            if (rel.isDrawable() && !ds.isSelected(rel) && !rel.isDisabledAndHidden()) {
View Full Code Here

                        if (m.isWay() && m.getWay().isClosed()) {
                            found.values().remove(m.getWay());
                        }
                    }
                    // estimate multipolygon size by its bounding box area
                    BBox bBox = r.getBBox();
                    EastNorth en1 = Main.map.mapView.getProjection().latlon2eastNorth(bBox.getTopLeft());
                    EastNorth en2 = Main.map.mapView.getProjection().latlon2eastNorth(bBox.getBottomRight());
                    double s = Math.abs((en1.east() - en2.east()) * (en1.north() - en2.north()));
                    if (s == 0) s = 1e8;
                    found.put(s, r);
                }
            }
View Full Code Here

                s.append(NL);
            }
        }

        void addBbox(OsmPrimitive o) {
            BBox bbox = o.getBBox();
            if (bbox != null) {
                add(tr("Bounding box: "), bbox.toStringCSV(", "));
                EastNorth bottomRigth = Main.getProjection().latlon2eastNorth(bbox.getBottomRight());
                EastNorth topLeft = Main.getProjection().latlon2eastNorth(bbox.getTopLeft());
                add(tr("Bounding box (projected): "),
                        Double.toString(topLeft.east()), ", ",
                        Double.toString(bottomRigth.north()), ", ",
                        Double.toString(bottomRigth.east()), ", ",
                        Double.toString(topLeft.north()));
                add(tr("Center of bounding box: "), bbox.getCenter().toStringCSV(", "));
            }
        }
View Full Code Here

     *
     * @return single point BBox defined by this coordinate.
     * @since 6203
     */
    public BBox toBBox() {
        return new BBox(x, y);
    }
View Full Code Here

     * @param r size
     * @return BBox around this coordinate
     * @since 6203
     */
    public BBox toBBox(final double r) {
        return new BBox(x - r, y - r, x + r, y + r);
    }
View Full Code Here

        }
    }

    @Override
    public void render(final DataSet data, boolean renderVirtualNodes, Bounds bounds) {
        BBox bbox = bounds.toBBox();
        getSettings(renderVirtualNodes);

        data.getReadLock().lock();
        try {
            highlightWaySegments = data.getHighlightedWaySegments();
View Full Code Here

TOP

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

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.