Package org.openstreetmap.josm.data.coor

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


    }

    public Bounds getWorldBoundsLatLon()
    {
        return new Bounds(
        new LatLon(45.7, 5.7),
        new LatLon(47.9, 10.6));
    }
View Full Code Here


        }
      }
    }

    if (todo != null) {
      centroid = new LatLon(todo.x + todo.width / 2, todo.y + todo.height
          / 2);
    }
  }
View Full Code Here

        }
      }
    }

    if (todo != null) {
      centroid = new LatLon(todo.x, todo.y);
    }
  }
View Full Code Here

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

    @Override public Icon getIcon() {
        return LogicConstants.getIcon(name);
    }

    public String scale(){
        LatLon ll1 = mv.getLatLon(0,0);
        LatLon ll2 = mv.getLatLon(100,0);
        double dist = ll1.greatCircleDistance(ll2);
        return dist > 1000 ? (Math.round(dist/100)/10.0)+" km" : Math.round(dist*10)/10+" m";
    }
View Full Code Here

    @Override public void mergeFrom(Layer from) {
    }

    private Bounds XYtoBounds (int x, int y) {
        return new Bounds(
            new LatLon(      x * ImageSize / pixelPerDegree,       y * ImageSize / pixelPerDegree),
            new LatLon((x + 1) * ImageSize / pixelPerDegree, (y + 1) * ImageSize / pixelPerDegree));
    }
View Full Code Here

      protected Object doInBackground() throws Exception {
        String mapMenuNewPlanning = i18n
            .getString("map.menu.new.planning");
        try {
          if (e.getActionCommand().equals(mapMenuNewPlanning)) {
            LatLon from = RoutingMap.this.mapView
                .getLatLon(RoutingMap.this.mapView.lastMEvent
                    .getPoint().x,
                    RoutingMap.this.mapView.lastMEvent
                        .getPoint().y);
            newPlan(from);
View Full Code Here

          toremove.add(l);
      }
      for (Layer l : toremove)
        this.mapView.removeLayer(l);

      LatLon latlon_origin = null;
      int id_layer = 0;
      for (TSPPlan plan : res) {
        latlon_origin = new LatLon(plan.getOrigin()[1],
            plan.getOrigin()[0]);
        log.info(latlon_origin);
        LineElemStyle ls = new LineElemStyle();
        float f = random.nextFloat();
        ls.color = Color
            .getHSBColor(f * random.nextFloat(), 0.9f, 0.9f);
        ls.width = LogicConstants.getInt("PLAN_WAY_WIDTH", 2);
        MarkerLayer stops = new MarkerLayer(new GpxData(), "Stops "
            + id_layer, File.createTempFile("stops", "tmp"),
            new GpxLayer(new GpxData()), this.mapView);
        stops.data.add(new StopMarker(latlon_origin, "origin",
            "tsp_stop", stops, 0, 0, ls.color));
        for (String stop : plan.getStops()) {
          String[] array = stop.split(",");
          double[] point = new double[2];
          point[1] = new Double(array[0]);
          point[0] = new Double(array[1]);

          LatLon ll = new LatLon(point[0], point[1]);
          log.info(ll);
          stops.data.add(new StopMarker(ll, array[2], "tsp_stop",
              stops, 0, 0, ls.color));
        }
        this.mapView.addLayer(stops, true);

        OsmDataLayer layer = new OsmDataLayer(new DataSet(),
            "Route Plan " + id_layer++, File.createTempFile(
                "planning", "route"));
        String way2 = plan.getWay();

        if (way2 != null) {
          Way way = new Way();
          LatLon info = null;

          MultiLineString multilinestring = (MultiLineString) wktReader
              .read(way2);
          multilinestring.getLength();
          int numGeometries = multilinestring.getNumGeometries();
          for (int i = 0; i < numGeometries; i++) {
            for (Coordinate coordenada : multilinestring
                .getGeometryN(i).getCoordinates()) {
              LatLon ll = new LatLon(coordenada.y, coordenada.x);
              way.addNode(new Node(ll));
              if (info == null)
                info = ll;
            }
            way.mappaintStyle = ls;
View Full Code Here

  /**
   *
   * @param r
   */
  public NearestResourcesDialog(Recurso r, CustomMapView view) {
    this(new LatLon(r.getHistoricoGps().getPosY(), r.getHistoricoGps()
        .getPosX()), view);
    if (!isVisible(r)) {
      notification
          .setText(i18n
              .getString("window.nearest.notificacion.resourceNotVisible"));
View Full Code Here

                        .before(new Date(
                            System.currentTimeMillis()
                                - LogicConstants
                                    .getInt("AVL_TIMEOUT")
                                * 6000))) {
                  point = new LatLon(
                      ultimaPosicionRecurso.getPosY(),
                      ultimaPosicionRecurso.getPosX());
                  printCoordinates(point);
                }
              }

              log.info("Buscamos los más cercanos a " + point);
              Recurso[] rs = RecursoConsultas.getNearest(
                  point.getX(), point.getY(), num,
                  Authentication.getUsuario());
              log.info("Tenemos los más cercanos a " + point
                  + ", que son " + rs.length);
              Vector<Vector<Object>> rows = new Vector<Vector<Object>>();
              int k = 0;
              for (Integer i = 0; i < rs.length && k < num - 1; i++) {
                k++;
                if (!isVisible(rs[i])
                    || (recurso != null && recurso.getId()
                        .equals(rs[i].getId()))) {
                  log.info("No se muestra " + rs[i]);
                  k--;
                  continue;

                }
                HistoricoGPS h = rs[i].getHistoricoGps();

                LatLon ll = new LatLon(h.getPosY(), h.getPosX());
                Integer dist = (int) ll
                    .greatCircleDistance(point);

                Vector<Object> row = new Vector<Object>();
                row.add(i);
                row.add(rs[i].getIdentificador());
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.coor.LatLon

Copyright © 2018 www.massapicom. 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.