Package org.openstreetmap.josm.data.coor

Examples of org.openstreetmap.josm.data.coor.LatLon.lat()


    static protected Bounds extend(Bounds bbox, double amount) {
        LatLon min = bbox.getMin();
        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


        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

      LatLon p0 = newPositions[i];
      LatLon p1 = newPositions[0];
      if (i + 1 != newPositions.length)
        p1 = newPositions[i + 1];
      double dx = p1.lon() - p0.lon();
      double dy = p1.lat() - p0.lat();
      for (int j = 0; j < fold; j++) {
        positions[i * fold + j] = new LatLon(p0.lat()
            + (dy * (j / ((double) fold))), p0.lon()
            + (dx * (j / ((double) fold))));
      }
View Full Code Here

          UTM u = new UTM(LogicConstants.getInt("ZONA_UTM"));
          EastNorth en = u.latlon2eastNorth(ll);
          position = String.format("x: %.1f y: %.1f", en.getX(), en
              .getY());
        } else {
          position = String.format("Lat: %.4f Lon: %.4f", ll.lat(),
              ll.lon());
        }

        posField.setText(position);
        validate();
View Full Code Here

     * @return eastnorth projection in Lambert Zone (ellipsoid Clark)
     */
    public EastNorth latlon2eastNorth(LatLon p) {
        // translate ellipsoid GRS80 (WGS83) => Clark
        LatLon geo = GRS802Clark(p);
        double lt = geo.lat(); // in radian
        double lg = geo.lon();

        // check if longitude and latitude are inside the French Lambert zones
        currentZone = 0;
        boolean outOfLambertZones = false;
View Full Code Here

            geo = Geographic(p, Xs[currentZone], Ys[currentZone], c[currentZone], n[currentZone]);
        else
            geo = Geographic(p, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]);
        // translate ellipsoid Clark => GRS80 (WGS83)
        LatLon wgs = Clark2GRS80(geo);
        return new LatLon(Math.toDegrees(wgs.lat()), Math.toDegrees(wgs.lon()));
    }

    @Override public String toString() {
        return tr("Lambert Zone (France)");
    }
View Full Code Here

            f.setCreador(Authentication.getUsuario());
            LatLon from = mapViewLocal.getLatLon(mouseEvent.getX(),
                mouseEvent.getY());
            GeometryFactory gf = new GeometryFactory();
            f.setGeometria(gf.createPoint(new Coordinate(
                from.lon(), from.lat())));
            IncidenceDialog id = new IncidenceDialog(
                f,
                i18n.getString("Incidences.summary.title")
                    + " "
                    + i18n.getString("Incidences.nuevaIncidencia"),
View Full Code Here

            return;
        LatLon minLatlon = Main.getProjection().eastNorth2latlon(bounds.getMin());
        LatLon maxLatlon = Main.getProjection().eastNorth2latlon(bounds.getMax());
        bounds = new ProjectionBounds(
                Main.getProjection().latlon2eastNorth(new LatLon(minLatlon.lat() - enlargeDegree, minLatlon.lon() - enlargeDegree)),
                Main.getProjection().latlon2eastNorth(new LatLon(maxLatlon.lat() + enlargeDegree, maxLatlon.lon() + enlargeDegree)));
    }

    /**
     * Enlarges the bounding box up to <code>maxEnlargePercent</code>, depending on
     * its size. If the bounding box is small, it will be enlarged more in relation
View Full Code Here

        LatLon coor = n.getCoor();
        if (coor == null) {
            xmin = xmax = ymin = ymax = 0;
        } else {
            xmin = xmax = coor.lon();
            ymin = ymax = coor.lat();
        }
    }

    private void sanity()  {
        if (xmin < -180.0) {
View Full Code Here

     */
    public void zoomTo(EastNorth newCenter, double newScale) {
        Bounds b = getProjection().getWorldBoundsLatLon();
        LatLon cl = Projections.inverseProject(newCenter);
        boolean changed = false;
        double lat = cl.lat();
        double lon = cl.lon();
        if(lat < b.getMinLat()) {changed = true; lat = b.getMinLat(); }
        else if(lat > b.getMaxLat()) {changed = true; lat = b.getMaxLat(); }
        if(lon < b.getMinLon()) {changed = true; lon = b.getMinLon(); }
        else if(lon > b.getMaxLon()) {changed = true; lon = b.getMaxLon(); }
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.