Package ch.epfl.lbd.database.spatial

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


      statement = "'"+(String)value+"'";
    }
   
    else if(value instanceof Geometry){
      if(value.getClass() == LatLngPoint.class){
        LatLngPoint val = (LatLngPoint)value;
        statement = "GeometryFromText('LINESTRING("+val.getLat()+" "+val.getLng()+","+val.getLat()+" "+val.getLng()+")',4030)";
        //statement = "GeometryFromText('POINT("+val.getLat()+" "+val.getLng()+")')";
      }
      else if(value.getClass() == Polygon.class){
        //TODO: insert statements for polygons
      }
     
      else if(value.getClass() == PolyLine.class){
        PolyLine val = (PolyLine)value;
        String ptList = "";
        for(LatLngPoint pt : val.getPoints())ptList += pt.getLat()+" "+pt.getLng()+",";
        ptList = ptList.substring(0, ptList.length()-1);
        statement = "GeometryFromText('LINESTRING("+ptList+")',4030)";
      }
     
      else if(value.getClass() == Line.class){
View Full Code Here


  protected double mergingTolerance = 10; //meters
 
  public Stop(){
    super();
    geom = new LatLngPoint();

  }
View Full Code Here

  }
 
  public Stop(GPSPoint point){
    super(point);
    geom = new LatLngPoint(point.getLat(), point.getLng());
  }
View Full Code Here

 
  @Override
  public boolean merge(Episode other){
    //only stops can be merged with stops
    if(other.getClass().equals(Stop.class)){
      LatLngPoint point = (LatLngPoint)this.geom;
      if(other.getGeometry().distance(this.getGeometry()) < this.mergingTolerance){
        double newLat = (point.getLat()+other.geom.getCentroid().getLat())/2;
        double newLng = (point.getLng()+other.geom.getCentroid().getLng())/2;
       
        geom = new LatLngPoint(newLat, newLng);
        return true;
      }
     
      logger.debug("The Stop is too far from the actual Stop");
      return false;
View Full Code Here

        LatLngPoint[] points = new LatLngPoint[2];
        points[0] = first;
        points[1] = (GPSPoint)((Move)other).first;
        geom = new PolyLine(points);
      }
      LatLngPoint point = (LatLngPoint)((Move)other).first;
      ((PolyLine)this.geom).addPoint(point);

      return true;
    }
    logger.error("Trying to Merge Stop and another Episode type");
View Full Code Here

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

TOP

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

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.