Examples of east()


Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
        //long start = System.currentTimeMillis();
        EastNorth topLeft = mv.getEastNorth(0, 0);
        EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight());

        if (botRight.east() == 0.0 || botRight.north() == 0) {
            /*Main.debug("still initializing??");*/
            // probably still initializing
            return;
        }

View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

    public final EastNorth getEastNorth() {
        if (Double.isNaN(east) || Double.isNaN(north)) {
            // projected coordinates haven't been calculated yet,
            // so fill the cache of the projected waypoint coordinates
            EastNorth en = Projections.project(new LatLon(lat, lon));
            this.east = en.east();
            this.north = en.north();
        }
        return new EastNorth(east, north);
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

        Set<Point> requestedTiles = new HashSet<>();
        for (LatLon point: points) {
            EastNorth minEn = Main.getProjection().latlon2eastNorth(new LatLon(point.lat() - bufferY, point.lon() - bufferX));
            EastNorth maxEn = Main.getProjection().latlon2eastNorth(new LatLon(point.lat() + bufferY, point.lon() + bufferX));
            int minX = getImageXIndex(minEn.east());
            int maxX = getImageXIndex(maxEn.east());
            int minY = getImageYIndex(minEn.north());
            int maxY = getImageYIndex(maxEn.north());

            for (int x=minX; x<=maxX; x++) {
                for (int y=minY; y<=maxY; y++) {
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

                || bmaxy < request.getYIndex())
            return -1;

        MouseEvent lastMEvent = Main.map.mapView.lastMEvent;
        EastNorth cursorEastNorth = Main.map.mapView.getEastNorth(lastMEvent.getX(), lastMEvent.getY());
        int mouseX = getImageXIndex(cursorEastNorth.east());
        int mouseY = getImageYIndex(cursorEastNorth.north());
        int dx = request.getXIndex() - mouseX;
        int dy = request.getYIndex() - mouseY;

        return 1 + dx * dx + dy * dy;
 
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

                WayPoint R = null;
                for (WayPoint S : seg.getWayPoints()) {
                    EastNorth c = S.getEastNorth();
                    if (R == null) {
                        R = S;
                        rx = c.east();
                        ry = c.north();
                        x = px - rx;
                        y = py - ry;
                        double PRsq = x * x + y * y;
                        if (PRsq < PNminsq) {
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

                            PNminsq = PRsq;
                            bestEN = c;
                            bestTime = R.time;
                        }
                    } else {
                        sx = c.east();
                        sy = c.north();
                        double A = sy - ry;
                        double B = rx - sx;
                        double C = -A * rx - B * ry;
                        double RSsq = A * A + B * B;
 
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

                    }
                }
                if (R != null) {
                    EastNorth c = R.getEastNorth();
                    /* if there is only one point in the seg, it will do this twice, but no matter */
                    rx = c.east();
                    ry = c.north();
                    x = px - rx;
                    y = py - ry;
                    double PRsq = x * x + y * y;
                    if (PRsq < PNminsq) {
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

    protected void transformNodes() {
        for (Node n : nodes) {
            double cosPhi = Math.cos(rotationAngle);
            double sinPhi = Math.sin(rotationAngle);
            EastNorth oldEastNorth = oldStates.get(n).eastNorth;
            double x = oldEastNorth.east() - pivot.east();
            double y = oldEastNorth.north() - pivot.north();
            double nx =  cosPhi * x + sinPhi * y + pivot.east();
            double ny = -sinPhi * x + cosPhi * y + pivot.north();
            n.setEastNorth(new EastNorth(nx, ny));
        }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

        if (Double.isNaN(east) || Double.isNaN(north)) {
            // projected coordinates haven't been calculated yet,
            // so fill the cache of the projected node coordinates
            EastNorth en = Projections.project(new LatLon(lat, lon));
            this.east = en.east();
            this.north = en.north();
        }
        return new EastNorth(east, north);
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()

    public EastNorth getNodesCenter() {
        EastNorth sum = new EastNorth(0,0);

        for (Node n : nodes ) {
            EastNorth en = n.getEastNorth();
            sum = sum.add(en.east(), en.north());
        }
        return new EastNorth(sum.east()/this.nodes.size(), sum.north()/this.nodes.size());

    }
}
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.