Package org.worldbank.transport.tamt.shared

Examples of org.worldbank.transport.tamt.shared.TAMTPoint


  {
    //System.out.println("gprmc=" + gprmc);
    //System.out.println("gpgga" + gpgga);
   
    // set up new point
    TAMTPoint p = new TAMTPoint();
   
    parseGPRMC(gprmc, p);
    parseGPGGA(gpgga, p);
   
   
View Full Code Here


  {
    //System.out.println("gprmc=" + gprmc);
    //System.out.println("gpgga" + gpgga);
   
    // set up new point
    TAMTPoint p = new TAMTPoint();
    parseGPRMC(gprmc, p);
    parseGPGGA(gpgga, p);
   
    //System.out.println(p);
    /*
 
View Full Code Here

  {
    //System.out.println("gprmc=" + gprmc);
    //System.out.println("gpgga" + gpgga);
   
    // set up new point
    TAMTPoint p = new TAMTPoint();
    p.setId( UUID.randomUUID().toString() );
   
    parseGPRMC(gprmc, p);
    parseGPGGA(gpgga, p);
   
    // insert into database;
    //insertPoint(p);
    if( p.getTimestamp() != null)
    {
      appendPoint(p);
    }
   
  } 
View Full Code Here

         
          if( line.matches(patternGPRMC))
          {
            try {
             
              TAMTPoint p = new TAMTPoint();
              p.setId(UUID.randomUUID().toString());

              /*
               * Extract the data from the GPRMC sentence (ie,
               * line)
               */
              String[] data = pattern.split(line);

              // timestamp from hhmmss, ddmmyy
              String timestamp = parseDate(data[1], data[9]);
              p.setTimestamp(timestamp);

              // latitude (ddmm.ss), latitude hemisphere (N or S)
              double latitude = parseCoordRegex(data[3], data[4], coordRegex);
              p.setLatitude(latitude);

              // longitude (ddmm.ss), longitude hemisphere (E or
              // W)
              double longitude = parseCoordRegex(data[5], data[6], coordRegex);
              p.setLongitude(longitude);

              // bearing
              double bearing = Double.parseDouble(data[8]);
              p.setBearing(bearing);
             
              // speed (in knots)
              double speed = Double.parseDouble(data[7]);
              // convert to meters per second
              // 1 knot = 0.514444444 meters per second
              speed = (speed * 0.5144);
              p.setSpeed(speed);

              // if we have not failed up to this point
              // (as indicated by fetching the timestamp -- kind
              // of a hack)
              // then we can append the point to the COPY file
              if (p.getTimestamp() != null) {
                // append to a file in /tmp/
                StringBuffer sb = new StringBuffer();

                // id, gpsLogId, gpsTraceId, lat, lng, bearing, speed,
                // altitude, created, geometry (POINT)
                sb.append(nextSequence);
                sb.append(DELIMITER);
                sb.append(p.getId());
                sb.append(DELIMITER);
                sb.append(traceId); // the parent id of the
                          // GPSTrace containing the
                          // zip from which this point
                          // came
                sb.append(DELIMITER);
                sb.append(p.getLatitude());
                sb.append(DELIMITER);
                sb.append(p.getLongitude());
                sb.append(DELIMITER);
                sb.append(p.getBearing());
                sb.append(DELIMITER);
                sb.append(p.getSpeed());
                sb.append(DELIMITER);
                sb.append(p.getAltitude());
                sb.append(DELIMITER);
                sb.append(p.getTimestamp());
                sb.append(DELIMITER);
                sb.append("\\N"); // null for geometry;
                sb.append(DELIMITER);
                sb.append("\\N"); // null for tag_id;
                sb.append(DELIMITER);
View Full Code Here

TOP

Related Classes of org.worldbank.transport.tamt.shared.TAMTPoint

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.