Package org.openstreetmap.josm.data.coor

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


        + 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);
    }

    public LatLon eastNorth2latlon(EastNorth p) {
        return MapXYToLatLon((p.east()-500000.0)/UTMScaleFactor, p.north()/UTMScaleFactor, UTMCentralMeridian(getzone()));
    }
View Full Code Here


    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))
View Full Code Here

        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()
 
View Full Code Here

            + 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"))
View Full Code Here

                // see #9081 comment 6
                EastNorth c = node.getEastNorth();
                double[] angle = new double[4];
                for(int i = 0; i < 4; i++) {
                    EastNorth p = neighbors.get(i).getEastNorth();
                    angle[i] = Math.atan2(p.north() - c.north(), p.east() - c.east());
                }
                double[] deltaAngle = new double[3];
                for(int i = 0; i < 3; i++) {
                    deltaAngle[i] = angle[i+1] - angle[0];
                    if(deltaAngle[i] < 0)
View Full Code Here

            if (n.isKeyTrue("noexit"))
                return false;
            EastNorth coord = n.getEastNorth();
            if (coord == null)
                return false;
            Point2D p = new Point2D.Double(coord.east(), coord.north());
            if (line.getP1().distance(p) > len+dist)
                return false;
            if (line.getP2().distance(p) > len+dist)
                return false;
            return line.ptSegDist(p) < dist;
View Full Code Here

            }
        }

        // calculate the radius (r)
        EastNorth n1 = nodes.get(0).getEastNorth();
        double r = Math.sqrt(Math.pow(center.east()-n1.east(),2) +
                Math.pow(center.north()-n1.north(),2));

        // Order nodes by angle
        PolarNode[] angles = new PolarNode[nodes.size()];
        for(int i = 0; i < nodes.size(); i++) {
View Full Code Here

        double a;
        Node node;

        PolarNode(EastNorth center, Node n) {
            EastNorth pt = n.getEastNorth();
            this.a = Math.atan2(pt.north() - center.north(), pt.east() - center.east());
            this.node = n;
        }
    }

    /**
 
View Full Code Here

         * @param n Node to move
         * @return new MoveCommand
         */
        public MoveCommand createMoveCommand(Node n) {
            EastNorth en = toEastNorth();
            return new MoveCommand(n, en.east() - n.getEastNorth().east(), en.north() - n.getEastNorth().north());
        }
    }

   
    /**
 
View Full Code Here

            if(Main.map.mapView.contains(pos)) {
                mPosition = Main.map.mapView.getEastNorth(pos.x, pos.y);
            }
        }

        double offsetEast  = mPosition.east() - (maxEast + minEast)/2.0;
        double offsetNorth = mPosition.north() - (maxNorth + minNorth)/2.0;

        // Make a copy of pasteBuffer and map from old id to copied data id
        List<PrimitiveData> bufferCopy = new ArrayList<>();
        List<PrimitiveData> toSelect = new ArrayList<>();
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.