Package net.sourceforge.gpstools.gpx

Examples of net.sourceforge.gpstools.gpx.Trk


    metadata.setTime(new Date());
    GpxType gpx = new Gpx();
    gpx.setCreator(CREATOR);
    gpx.setMetadata(metadata);

    Trk track = new Trk();
    track.setName(recurso);
    Trkseg segmento = new Trkseg();
    for (HistoricoGPS hist : historico) {
      Geometry geom = hist.getGeom();
      if (geom != null && geom.getCentroid().getX() != 0.0d
          && geom.getCentroid().getY() != 0.0d) {

        Trkpt punto = new Trkpt();
        punto.setLon(BigDecimal.valueOf(geom.getCentroid().getX()));
        punto.setLat(BigDecimal.valueOf(geom.getCentroid().getY()));
        punto.setTime(hist.getMarcaTemporal());
        punto.setName(recurso
            + " "
            + DateFormat.getDateInstance(DateFormat.SHORT, LOCALE)
                .format(new Date(hist.getMarcaTemporal()
                    .getTime()))
            + " "
            + DateFormat.getTimeInstance(DateFormat.MEDIUM, LOCALE)
                .format(new Date(hist.getMarcaTemporal()
                    .getTime())));

        segmento.addTrkpt(punto);
      }

    }
    track.addTrkseg(segmento);
    gpx.addTrk(track);
    return gpx;

  }
View Full Code Here

TOP

Related Classes of net.sourceforge.gpstools.gpx.Trk

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.