Package org.openstreetmap.josm.data

Examples of org.openstreetmap.josm.data.Bounds


    /*
     * Converts from boxes to bounds
     */
    public static Bounds toBounds(Box bbox) {
        return new Bounds(fromFpi(bbox.y.min), fromFpi(bbox.x.min),
                fromFpi(bbox.y.max), fromFpi(bbox.x.max));
    }
View Full Code Here


    }

    @Test
    public void test2() {
        Collection<Bounds> existing = new ArrayList<Bounds>();
        existing.add(new Bounds(0, 0, 1, 1));

        BoxStrategy strat = new BoxStrategy();

        Collection<Bounds> r = strat.getBoxes(new Bounds(0, -1, 1, 2), existing, 3);

        assertEquals(2, r.size());
        for (Bounds b : r) {
            assertEquals(1, b.getArea(), 0.000000001);
        }
View Full Code Here

    @Override
    public void zoomChanged() {
        if (Main.map == null)
            return;
        MapView mv = Main.map.mapView;
        Bounds bbox = mv.getLatLonBounds(mv.getBounds());

        // Have the user changed view since last time
        if (active && (lastBbox == null || !lastBbox.equals(bbox))) {
            if (task != null) {
                task.cancel();
View Full Code Here

        this.fetch(bbox, OsmDataLayer.class);
        this.fetch(bbox, GpxLayer.class);
    }

    public void fetch(Bounds bbox, Class<?> klass) {
        Bounds extendedBox = extend(bbox, Main.pref.getDouble("plugin.continuos_download.extra_download", 0.1));
        Collection<Bounds> existing = getExisting(klass);
        if (existing.size() == 0)
            return;
        Collection<Bounds> toFetch = getBoxes(extendedBox, existing,
                Main.pref.getInteger("plugin.continuos_download.max_areas", 4));
View Full Code Here

        double minX = Math.max(minX1, minX2);
        double maxX = Math.min(maxX1, maxX2);
        double minY = Math.max(minY1, minY2);
        double maxY = Math.min(maxY1, maxY2);

        return new Bounds(minY, minX, maxY, maxX);
    }
View Full Code Here

        LatLon max = bbox.getMax();

        double dLat = Math.abs(max.lat() - min.lat()) * amount;
        double dLon = Math.abs(max.lon() - min.lon()) * amount;

        return new Bounds(min.lat() - dLat, min.lon() - dLon, max.lat() + dLat, max.lon() + dLon);
    }
View Full Code Here

        return new LatLon(lt, lg);
    }

    public ProjectionBounds getWorldBounds()
    {
        Bounds b = getWorldBoundsLatLon();
        return new ProjectionBounds(latlon2eastNorth(b.min), latlon2eastNorth(b.max));
    }
View Full Code Here

        return new ProjectionBounds(latlon2eastNorth(b.min), latlon2eastNorth(b.max));
    }

    public Bounds getWorldBoundsLatLon()
    {
        return new Bounds(
        new LatLon(-90.0, -180.0),
        new LatLon(90.0, 180.0));
    }
View Full Code Here

        return "lambertest";
    }

    public ProjectionBounds getWorldBounds()
    {
        Bounds b = getWorldBoundsLatLon();
        return new ProjectionBounds(latlon2eastNorth(b.min), latlon2eastNorth(b.max));
    }
View Full Code Here

        return new ProjectionBounds(latlon2eastNorth(b.min), latlon2eastNorth(b.max));
    }

    public Bounds getWorldBoundsLatLon()
    {
        return new Bounds(
        new LatLon(-90.0, -180.0),
        new LatLon(90.0, 180.0));
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.Bounds

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.