Examples of ProjectionBounds


Examples of org.openstreetmap.josm.data.ProjectionBounds

    public void addRequest(WMSRequest request) {
        requestQueueLock.lock();
        try {

            if (cache != null) {
                ProjectionBounds b = getBounds(request);
                // Checking for exact match is fast enough, no need to do it in separated thread
                request.setHasExactMatch(cache.hasExactMatch(Main.getProjection(), request.getPixelPerDegree(), b.minEast, b.minNorth));
                if (request.isPrecacheOnly() && request.hasExactMatch())
                    return; // We already have this tile cached
            }
View Full Code Here

Examples of org.openstreetmap.josm.data.ProjectionBounds

            return new WMSGrabber(Main.map.mapView, this, localOnly);
        else throw new IllegalStateException("getGrabber() called for non-WMS layer type");
    }

    public ProjectionBounds getBounds(WMSRequest request) {
        ProjectionBounds result = new ProjectionBounds(
                getEastNorth(request.getXIndex(), request.getYIndex()),
                getEastNorth(request.getXIndex() + 1, request.getYIndex() + 1));

        if (WMSLayer.PROP_OVERLAP.get()) {
            double eastSize =  result.maxEast - result.minEast;
            double northSize =  result.maxNorth - result.minNorth;

            double eastCoef = WMSLayer.PROP_OVERLAP_EAST.get() / 100.0;
            double northCoef = WMSLayer.PROP_OVERLAP_NORTH.get() / 100.0;

            result = new ProjectionBounds(result.getMin(),
                    new EastNorth(result.maxEast + eastCoef * eastSize,
                            result.maxNorth + northCoef * northSize));
        }
        return result;
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.ProjectionBounds

            double maxPPD = pixelPerDegree * 5;
            projectionEntries = getProjectionEntries(projection);

            double size2 = tileSize / pixelPerDegree;
            double border = tileSize * 0.01; // Make sure not to load neighboring tiles that intersects this tile only slightly
            ProjectionBounds bounds = new ProjectionBounds(east + border, north + border,
                    east + size2 - border, north + size2 - border);

            //TODO Do not load tile if it is completely overlapped by other tile with better ppd
            for (CacheEntry entry: projectionEntries.entries) {
                if (entry.pixelPerDegree >= minPPD && entry.pixelPerDegree <= maxPPD && entry.bounds.intersects(bounds)) {
View Full Code Here

Examples of org.openstreetmap.josm.data.ProjectionBounds

        CacheEntry(double pixelPerDegree, double east, double north, int tileSize, String filename) {
            this.pixelPerDegree = pixelPerDegree;
            this.east = east;
            this.north = north;
            this.bounds = new ProjectionBounds(east, north, east + tileSize / pixelPerDegree, north + tileSize / pixelPerDegree);
            this.filename = filename;
        }
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.