Package org.onebusaway.geospatial.model

Examples of org.onebusaway.geospatial.model.CoordinatePoint


  public Set<CoordinatePoint> getAllCoordinates() {
    return _allCoordinates;
  }

  public void addLatLon(float latitude, float longitude) {
    CoordinatePoint cp = new CoordinatePoint(latitude, longitude);
    _allCoordinates.add(cp);
  }
View Full Code Here


    CoordinatePoint cp = new CoordinatePoint(latitude, longitude);
    _allCoordinates.add(cp);
  }

  public void addLatLon(double latitude, double longitude) {
    CoordinatePoint cp = new CoordinatePoint(latitude, longitude);
    _allCoordinates.add(cp);
  }
View Full Code Here

  public double getLon() {
    return lon;
  }

  public CoordinatePoint toCoordinatePoint() {
    return new CoordinatePoint(lat, lon);
  }
View Full Code Here

      if (centerOfMass.count == 0) {
        _log.warn("Agency has no service: " + agency);
      } else {
        double lat = centerOfMass.lats / centerOfMass.count;
        double lon = centerOfMass.lons / centerOfMass.count;
        centersByAgencyId.put(agency.getId(), new CoordinatePoint(lat, lon));
      }
    }

    return centersByAgencyId;
  }
View Full Code Here

  public double getDistTraveledForIndex(int index) {
    return distTraveled[index];
  }
 
  public CoordinatePoint getPointForIndex(int index) {
    return new CoordinatePoint(lats[index],lons[index]);
  }
View Full Code Here

      location.setLastLocationUpdateTime(record.getTimeOfLocationUpdate());
      location.setScheduleDeviation(record.getScheduleDeviation());
      location.setScheduleDeviations(cacheElement.getScheduleDeviations());

      if (record.isCurrentLocationSet()) {
        CoordinatePoint p = new CoordinatePoint(record.getCurrentLocationLat(),
            record.getCurrentLocationLon());
        location.setLastKnownLocation(p);
      }
      location.setOrientation(record.getCurrentOrientation());
      location.setPhase(record.getPhase());
View Full Code Here

    double[] lons = new double[indexTo + 2];

    System.arraycopy(shapePoints.getLats(), 0, lats, 0, indexTo + 1);
    System.arraycopy(shapePoints.getLons(), 0, lons, 0, indexTo + 1);

    CoordinatePoint to = interpolate(shapePoints, toStop);
    lats[indexTo + 1] = to.getLat();
    lons[indexTo + 1] = to.getLon();

    EncodedPolylineBean bean = PolylineEncoder.createEncodings(lats, lons);
    return bean.getPoints();
  }
View Full Code Here

    double[] lons = new double[sizeExtended];

    System.arraycopy(shapePoints.getLats(), indexFrom + 1, lats, 1, size - 1);
    System.arraycopy(shapePoints.getLons(), indexFrom + 1, lons, 1, size - 1);

    CoordinatePoint from = interpolate(shapePoints, fromStop);
    lats[0] = from.getLat();
    lons[0] = from.getLon();

    if (nextPoint != null) {
      lats[sizeExtended - 1] = nextPoint.getLat();
      lons[sizeExtended - 1] = nextPoint.getLon();
    }
View Full Code Here

    double[] lons = new double[size];

    System.arraycopy(shapePoints.getLats(), indexFrom + 1, lats, 1, size - 2);
    System.arraycopy(shapePoints.getLons(), indexFrom + 1, lons, 1, size - 2);

    CoordinatePoint from = interpolate(shapePoints, fromStop);
    lats[0] = from.getLat();
    lons[0] = from.getLon();

    CoordinatePoint to = interpolate(shapePoints, toStop);
    lats[size - 1] = to.getLat();
    lons[size - 1] = to.getLon();

    EncodedPolylineBean bean = PolylineEncoder.createEncodings(lats, lons);
    return bean.getPoints();
  }
View Full Code Here

    double[] distances = shapePoints.getDistTraveled();

    int index = stop.getShapePointIndex();

    if (index + 1 == lats.length)
      return new CoordinatePoint(lats[index], lons[index]);

    double d1 = distances[index];
    double d2 = distances[index + 1];

    if (d1 == d2)
      return new CoordinatePoint(lats[index], lons[index]);

    double ratio = (stop.getShapeDistTraveled() - d1) / (d2 - d1);

    double lat = InterpolationLibrary.interpolatePair(lats[index],
        lats[index + 1], ratio);
    double lon = InterpolationLibrary.interpolatePair(lons[index],
        lons[index + 1], ratio);

    return new CoordinatePoint(lat, lon);
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.geospatial.model.CoordinatePoint

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.