Package ch.epfl.lbd.database.spatial

Examples of ch.epfl.lbd.database.spatial.NMEAPoint


  public void testReader() throws Exception {

    NMEAReader reader = new NMEAReader(new File("src/assets/Nottingham_Bolton.nmea"),NMEAReader.VERS_0183);
    reader.open();
    while(true){
      NMEAPoint point = reader.getNextNMEAPoint();
      if(point == null)break;
      logger.info(point.toString());
    }
  }
View Full Code Here


   
    return data;
  }
  //TODO: to be tested
  public NMEAPoint getNextNMEAPoint(){
    NMEAPoint nmeaPoint;
   
    String[] data = this.read();
    if(data == null)return null;
   
    LatLngPoint point = new LatLngPoint(Double.parseDouble(data[3]),Double.parseDouble(data[5]),"point_"+readPoints,"point_"+readPoints);
    Date date = new Date();
   
    String month   = data[9].substring(2,3);
    String day     = data[9].substring(0,1);
    String year   = data[9].substring(4,5);
    String hours   = data[1].substring(0,1);
    String minutes   = data[1].substring(2,3);
    String seconds   = data[1].substring(4,5);
    String sDate   = month+"-"+day+"-"+year+" "+hours+":"+minutes+":"+seconds;
     
    try {
        SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-yy HH:mm:ss");
        ParsePosition pos = new ParsePosition(0);
        date = formatter.parse(sDate,pos);
      }
      catch (RuntimeException e) {
        e.printStackTrace();
      }
     
    nmeaPoint = new NMEAPoint(point,date,true,"","",1.1,1.1,1.1);

    readPoints++;
    return nmeaPoint;
  }
View Full Code Here

TOP

Related Classes of ch.epfl.lbd.database.spatial.NMEAPoint

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.