Package org.openstreetmap.josm.data.coor

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


  private static LatLon extractLatLon(String[] numeros) {
    Double x = new Double(numeros[0]);
    Double y = new Double(numeros[1]);
    EastNorth en = new EastNorth(x, y);

    LatLon latlon = UTMConverter.eastNorth2latlon(en);
    return latlon;
  }
View Full Code Here


        for (Coordinate coordenada : ((LineString) mls.getGeometryN(i))
            .getCoordinates()) {
          Point p = f.createPoint(coordenada);
          p = (Point) JTS.transform(p,
              CRS.findMathTransform(targetCRS, sourceCRS));
          LatLon ll = new LatLon(p.getY(), p.getX());
          way.addNode(new Node(ll));
          // if (log.isTraceEnabled())
          // BasicWindow.showOnMap(ll, 1);
        }
        res.add(way);
View Full Code Here

          // zoom
          // level for the speed of the followed object
          double dist = (lastDistance + Main.proj.eastNorth2latlon(
              follow.eastNorth).greatCircleDistance(
              Main.proj.eastNorth2latlon(lastFollowPos))) / 2;
          LatLon ll1 = getLatLon(0, 0);
          LatLon ll2 = getLatLon((int) (40 / fps), 0);
          double sampledist = ll1.greatCircleDistance(ll2); // get a
          // sample distance of 20px on the screen
          if (dist > sampledist * 1.5) { // if we move more than +-50%
            // of 20px -> zoom out
            zoomFactor = Math.max(zoomFactor - 1, getMinZoom());
View Full Code Here

   * @see es.emergya.ui.gis.ICustomMapView#updateMarkers()
   */
  @Override
  public void updateMarkers() {
    Rectangle r = getBoundingBox();
    final LatLon tl, br;
    // tomamos los pois en un area de 3 pantallas cuadradas, de manera que
    // se pueda arrastrar sin notar que no estan cargados los poi de mas
    // allá, ya que solo se deberian cargar cuando deja de moverse.
    tl = getLatLon(r.x - r.width, r.y - r.height);
    br = getLatLon(r.x + 2 * r.width, r.y + 2 * r.height);
 
View Full Code Here

    for (Recurso r : allres) {
      HistoricoGPS h = r.getHistoricoGps();
      if (h == null) {
        continue;
      }
      WayPoint w = new WayPoint(new LatLon(h.getPosY(), h.getPosX()));
      String name = r.getNombre();

      if (r.getPatrullas() != null)
        name += " (" + r.getPatrullas().getNombre() + ")";
View Full Code Here

      try {
        if (i.getGeometria() != null) {
          final com.vividsolutions.jts.geom.Point centroid = i
              .getGeometria().getCentroid();
          if (centroid != null) {
            LatLon latlon = new LatLon(centroid.getCoordinate().y,
                centroid.getCoordinate().x);
            WayPoint w = new WayPoint(latlon);
            w.attr.put("name",
                i.getTitulo() + " (" + i.getPrioridad() + ")");
            w.attr.put(
View Full Code Here

        return Double.NaN;
      }
    }

    private LatLon parseLatLon(Attributes atts) {
      return new LatLon(parseCoord(atts.getValue("lat")), parseCoord(atts
          .getValue("lon")));
    }
View Full Code Here

    fillAlpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref
        .getInteger("mappaint.fillalpha", 50))));
    showNames = Main.pref.getInteger("mappaint.shownames", 10000000);
    showIcons = Main.pref.getInteger("mappaint.showicons", 10000000);
    useStrokes = Main.pref.getInteger("mappaint.strokes", 10000000);
    LatLon ll1 = nc.getLatLon(0, 0);
    LatLon ll2 = nc.getLatLon(100, 0);
    dist = ll1.greatCircleDistance(ll2);

    // long profilerStart = java.lang.System.currentTimeMillis();
    // long profilerLast = profilerStart;
    // int profilerN;
View Full Code Here

     * @param p  WGS84 lat/lon (ellipsoid GRS80) (in degree)
     * @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;
        if (lt >= zoneLimits[3] && lt <= cMaxLatZone1 && lg >= cMinLonZones && lg <= cMaxLonZones) {
View Full Code Here

        } // else
        return ConicProjection(lt, lg, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]);
    }

    public LatLon eastNorth2latlon(EastNorth p) {
        LatLon geo;
        if (layoutZone == -1)
            // possible until the Lambert zone is determined by latlon2eastNorth() with a valid LatLon
            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()));
    }
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.