Examples of east()


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

        int nc = nodes.size();
        double area = 0;
        for(int i = 0; i < nc; i++) {
            EastNorth p1 = nodes.get(i).getEastNorth();
            EastNorth p2 = nodes.get((i+1) % nc).getEastNorth();
            area += p1.east()*p2.north() - p2.east()*p1.north();
        }
        if(area < 0)
            Collections.reverse(nodes);
        return nodes;
    }
View Full Code Here

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

                        // Get a "typical" distance in east/north units that
                        // corresponds to a couple of pixels. Shouldn't be too
                        // large, to keep it within projection bounds and
                        // not too small to avoid rounding errors.
                        double dist = 0.01 * proj.getDefaultZoomInPPD();
                        LatLon ll1 = proj.eastNorth2latlon(new EastNorth(center.east() - dist, center.north()));
                        LatLon ll2 = proj.eastNorth2latlon(new EastNorth(center.east() + dist, center.north()));
                        double meterPerEasting = ll1.greatCircleDistance(ll2) / dist / 2;
                        double scale = meterPerPixel / meterPerEasting; // unit: easting per pixel
                        viewport = new ViewportData(center, scale);
                    } catch (NumberFormatException ex) {
View Full Code Here

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

                        // corresponds to a couple of pixels. Shouldn't be too
                        // large, to keep it within projection bounds and
                        // not too small to avoid rounding errors.
                        double dist = 0.01 * proj.getDefaultZoomInPPD();
                        LatLon ll1 = proj.eastNorth2latlon(new EastNorth(center.east() - dist, center.north()));
                        LatLon ll2 = proj.eastNorth2latlon(new EastNorth(center.east() + dist, center.north()));
                        double meterPerEasting = ll1.greatCircleDistance(ll2) / dist / 2;
                        double scale = meterPerPixel / meterPerEasting; // unit: easting per pixel
                        viewport = new ViewportData(center, scale);
                    } catch (NumberFormatException ex) {
                        Main.warn(ex);
View Full Code Here

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

            } else if (candidateNode != null) {
                // Moving the highlighted node
                EastNorth nodeEN = candidateNode.getEastNorth();
                EastNorth cursorEN = mv.getEastNorth(mousePos.x, mousePos.y);

                Main.main.undoRedo.add(new MoveCommand(candidateNode, cursorEN.east() - nodeEN.east(), cursorEN.north()
                        - nodeEN.north()));
            }
        }

        mousePos = null;
View Full Code Here

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

            EastNorth B = seg.b.getEastNorth();
            seg = i.next();
            EastNorth C = seg.a.getEastNorth();
            EastNorth D = seg.b.getEastNorth();

            double u=det(B.east() - A.east(), B.north() - A.north(), C.east() - D.east(), C.north() - D.north());

            // Check for parallel segments and do nothing if they are
            // In practice this will probably only happen when a way has been duplicated

            if (u == 0)
View Full Code Here

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

            // q is a number between 0 and 1
            // It is the point in the segment where the intersection occurs
            // if the segment is scaled to lenght 1

            double q = det(B.north() - C.north(), B.east() - C.east(), D.north() - C.north(), D.east() - C.east()) / u;
            EastNorth intersection = new EastNorth(
                    B.east() + q * (A.east() - B.east()),
                    B.north() + q * (A.north() - B.north()));


View Full Code Here

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

            ll = new LatLon(0,0);
        }
        this.latLonCoordinates = ll;
        tfLatLon.setText(ll.latToString(CoordinateFormat.getDefaultFormat()) + " " + ll.lonToString(CoordinateFormat.getDefaultFormat()));
        EastNorth en = Main.getProjection().latlon2eastNorth(ll);
        tfEastNorth.setText(en.east()+" "+en.north());
        setOkEnabled(true);
    }

    public LatLon getCoordinates() {
        if (isLatLon()) {
View Full Code Here

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

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

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

    @Override
    public void mouseDragged(MouseEvent e) {
        if (layer == null || prevEastNorth == null) return;
        EastNorth eastNorth =
            Main.map.mapView.getEastNorth(e.getX(),e.getY());
        double dx = layer.getDx()+eastNorth.east()-prevEastNorth.east();
        double dy = layer.getDy()+eastNorth.north()-prevEastNorth.north();
        layer.setOffset(dx, dy);
        if (offsetDialog != null) {
            offsetDialog.updateOffset();
        }
View Full Code Here

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

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