Examples of EastNorth


Examples of org.openstreetmap.josm.data.coor.EastNorth

* @author imi
*/
public class Epsg4326 implements Projection {

    public EastNorth latlon2eastNorth(LatLon p) {
        return new EastNorth(p.lon(), p.lat());
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

        double l7coef = 61.0 - 479.0 * t2 + 179.0 * (t2 * t2) - (t2 * t2 * t2);

        double l8coef = 1385.0 - 3111.0 * t2 + 543.0 * (t2 * t2) - (t2 * t2 * t2);

        return new EastNorth(
        /* Calculate easting (x) */
        N * Math.cos (phi) * l
            + (N / 6.0 * Math.pow (Math.cos (phi), 3.0) * l3coef * Math.pow (l, 3.0))
            + (N / 120.0 * Math.pow (Math.cos (phi), 5.0) * l5coef * Math.pow (l, 5.0))
            + (N / 5040.0 * Math.pow (Math.cos (phi), 7.0) * l7coef * Math.pow (l, 7.0)),
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

        + x5frac * x5poly * Math.pow (x, 5.0)
        + x7frac * x7poly * Math.pow (x, 7.0)));
    }

    public EastNorth latlon2eastNorth(LatLon p) {
        EastNorth a = MapLatLonToXY(Math.toRadians(p.lat()), Math.toRadians(p.lon()), UTMCentralMeridian(getzone()));
        return new EastNorth(a.east() * UTMScaleFactor + 500000.0, a.north() * UTMScaleFactor);
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

                + 211455.93d  * lambdaprime
                - 10938.51d   * lambdaprime             * phiprime
                - 0.36d       * lambdaprime             * phiprime_2
                - 44.54d      * Math.pow(lambdaprime,3);

            return new EastNorth(east, north);
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

      // now succesively subtract downloaded areas
      for (DataSource src : data.dataSources) {
        if (src.bounds != null
            && !src.bounds.min.equals(src.bounds.max)) {
          EastNorth en1 = Main.proj.latlon2eastNorth(src.bounds.min);
          EastNorth en2 = Main.proj.latlon2eastNorth(src.bounds.max);
          Point p1 = mv.getPoint(en1);
          Point p2 = mv.getPoint(en2);
          Rectangle r = new Rectangle(Math.min(p1.x, p2.x), Math.min(
              p1.y, p2.y), Math.abs(p2.x - p1.x), Math.abs(p2.y
              - p1.y));
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

      w = 20;
    int h = getHeight() - 20;
    if (h < 20)
      h = 20;

    EastNorth oldCenter = center;
    double oldScale = this.scale;

    if (box == null || box.min == null || box.max == null) {
      // no bounds means whole world
      center = getProjection().latlon2eastNorth(new LatLon(0, 0));
      EastNorth world = getProjection().latlon2eastNorth(
          new LatLon(Projection.MAX_LAT, Projection.MAX_LON));
      double scaleX = world.east() * 2 / w;
      double scaleY = world.north() * 2 / h;
      scale = Math.max(scaleX, scaleY); // minimum scale to see all of the
                        // screen
    } else {
      if (box.min.equals(box.max))
        box.enlargeBoundingBox();
      center = new EastNorth(box.min.east() / 2 + box.max.east() / 2,
          box.min.north() / 2 + box.max.north() / 2);
      double scaleX = (box.max.east() - box.min.east()) / w;
      double scaleY = (box.max.north() - box.min.north()) / h;
      scale = Math.max(scaleX, scaleY); // minimum scale to see all of the
                        // screen
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

   * org.openstreetmap.josm.gui.IMapView#zoomTo(org.openstreetmap.josm.data
   * .coor.EastNorth, double)
   */
  @Override
  public void zoomTo(EastNorth newCenter, double scale) {
    EastNorth oldCenter = center;
    double oldScale = this.scale;
    super.zoomTo(newCenter, scale);
    if ((oldCenter == null && center != null) || !oldCenter.equals(center))
      firePropertyChange("center", oldCenter, center);
    if (oldScale != scale)
      firePropertyChange("scale", oldScale, scale);
  }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

        x = e.getX();
        return;
      }
      if (mousePosMove == null)
        startMovement(e);
      EastNorth center = nc.getCenter();
      EastNorth mouseCenter = nc.getEastNorth(e.getX(), e.getY());
      EastNorth p = new EastNorth(mousePosMove.east() + center.east()
          - mouseCenter.east(), mousePosMove.north() + center.north()
          - mouseCenter.north());
      nc.zoomTo(p, nc.getScale());
    } else
      endMovement();
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

            .getWhen(), e.getModifiers(), mouse.x, mouse.y, 0,
            false, MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, action
                .equals(",") ? -1 : 1);
        mouseWheelMoved(we);
      } else {
        EastNorth center = nc.getCenter();
        EastNorth newcenter = nc.getEastNorth(nc.getWidth() / 2
            + nc.getWidth() / 5, nc.getHeight() / 2
            + nc.getHeight() / 5);
        if (action.equals("left"))
          nc.zoomTo(new EastNorth(2 * center.east()
              - newcenter.east(), center.north()), nc.getScale());
        else if (action.equals("right"))
          nc.zoomTo(new EastNorth(newcenter.east(), center.north()),
              nc.getScale());
        else if (action.equals("up"))
          nc.zoomTo(new EastNorth(center.east(), 2 * center.north()
              - newcenter.north()), nc.getScale());
        else if (action.equals("down"))
          nc.zoomTo(new EastNorth(center.east(), newcenter.north()),
              nc.getScale());
      }
    }
View Full Code Here

Examples of org.openstreetmap.josm.data.coor.EastNorth

  private void printCoordinates(LatLon ll) {
    if (ll != null) {
      if (LogicConstants.get("FORMATO_COORDENADAS_MAPA", "UTM").equals(
          LogicConstants.COORD_UTM)) {
        UTM u = new UTM(LogicConstants.getInt("ZONA_UTM"));
        EastNorth en = u.latlon2eastNorth(ll);
        coordY.setText(String.valueOf(en.getX()));
        coordX.setText(String.valueOf(en.getY()));
      } else {
        coordX.setText(String.valueOf(ll.getX()));
        coordY.setText(String.valueOf(ll.getY()));
      }
    } else {
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.