Package org.onebusaway.geospatial.model

Examples of org.onebusaway.geospatial.model.CoordinatePoint


    CoordinateBounds b = SphericalGeometryLibrary.bounds(location, noise);
    double latSpan = b.getMaxLat() - b.getMinLat();
    double lonSpan = b.getMaxLon() - b.getMinLon();
    double lat = b.getMinLat() + Math.random() * latSpan;
    double lon = b.getMinLon() + Math.random() * lonSpan;
    return new CoordinatePoint(lat, lon);
  }
View Full Code Here


  protected EncodedPolylineBean getPathAsEncodedPath(BoundaryPath path) {
    DoublePoint p = new DoublePoint();
    List<CoordinatePoint> points = new ArrayList<CoordinatePoint>(path.size());
    for (int i = 0; i < path.size(); i++) {
      getIndexAndDirectionAsPoint(path.getIndex(i), path.getDirection(i), p);
      CoordinatePoint cp = new CoordinatePoint(p.lat, p.lon);
      points.add(cp);
    }

    // Re-add the first point to close the loop
    // I don't think this is actually right
View Full Code Here

        double lon = Double.parseDouble(tokens[2]);
        double accuracy = Double.parseDouble(tokens[3]);

        Record r = new Record();
        r.setTimestamp(t);
        r.setLocation(new CoordinatePoint(lat, lon));
        r.setAccuracy(accuracy);
        records.add(r);
       
        max.add(t, r);
View Full Code Here

  private static final double WALKING_SPEED_METERS_PER_MS = 0.0011176;

  @Test
  public void test() {

    CoordinatePoint center = new CoordinatePoint(47.653247216758494,
        -122.30838775634766);
    CoordinateBounds bounds = SphericalGeometryLibrary.bounds(center.getLat(),
        center.getLon(), 400);
    double latDelta = (bounds.getMaxLat() - bounds.getMinLat()) / 2;
    double lonDelta = (bounds.getMaxLon() - bounds.getMinLon()) / 2;
    System.out.println(latDelta);

    TimedGridFactory factory = new TimedGridFactory(latDelta, lonDelta,
        WALKING_SPEED_METERS_PER_MS);

    factory.addPoint(center.getLat(), center.getLon(), 0, 300 * 1000);

    System.out.println(WALKING_SPEED_METERS_PER_MS * 120 * 1000);

    Map<Integer, List<EncodedPolygonBean>> polygonsByTime = factory.getPolygonsByTime(1);

View Full Code Here

        String[] tokens = line.split(" ");
        double lat1 = Double.parseDouble(tokens[0]);
        double lon1 = Double.parseDouble(tokens[1]);
        double lat2 = Double.parseDouble(tokens[2]);
        double lon2 = Double.parseDouble(tokens[3]);
        CoordinatePoint p1 = new CoordinatePoint(lat1, lon1);
        CoordinatePoint p2 = new CoordinatePoint(lat2, lon2);
        Pair<CoordinatePoint> pair = Tuples.pair(p1, p2);
        points.add(pair);
      }

      long tTotal = 0;
View Full Code Here

  private void printLineString(PrintWriter out, UTMProjection proj,
      LineString line, boolean latFirst) {
    for (int i = 0; i < line.getNumPoints(); i++) {
      Point point = line.getPointN(i);
      XYPoint p = new XYPoint(point.getX(), point.getY());
      CoordinatePoint c = proj.reverse(p);
      if (latFirst)
        out.println(c.getLat() + " " + c.getLon());
      else
        out.println(c.getLon() + " " + c.getLat());
    }
  }
View Full Code Here

      if (_projection == null) {
        int zone = UTMLibrary.getUTMZoneForLongitude(stop.getLon());
        _projection = new UTMProjection(zone);
      }

      XYPoint point = _projection.forward(new CoordinatePoint(stop.getLat(),
          stop.getLon()));

      Point p = _factory.createPoint(new Coordinate(point.getX(), point.getY()));
      Geometry geometry = p.buffer(_bufferRadiusInMeters).getEnvelope();
View Full Code Here

      int[] rLon = decodeSignedNumberWithIndex(pointString, strIndex);
      lon = lon + rLon[0] * 1e-5;
      strIndex = rLon[1];

      points.add(new CoordinatePoint(lat, lon));
    }

    return points;
  }
View Full Code Here

      _length = length;
    }

    @Override
    public CoordinatePoint get(int index) {
      return new CoordinatePoint(_lat[_offset + index], _lon[_offset + index]);
    }
View Full Code Here

      MinTravelTimeToStopsBean travelTimes) {
    List<MinTravelTimeToStopV2Bean> beans = new ArrayList<MinTravelTimeToStopV2Bean>();
    for (int i = 0; i < travelTimes.getSize(); i++) {
      MinTravelTimeToStopV2Bean bean = new MinTravelTimeToStopV2Bean();
      bean.setStopId(travelTimes.getStopId(i));
      bean.setLocation(new CoordinatePoint(travelTimes.getStopLat(i),
          travelTimes.getStopLon(i)));
      bean.setTravelTime(travelTimes.getTravelTime(i));
      beans.add(bean);
    }
    return list(beans, false);
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.