Package org.onebusaway.geospatial.model

Examples of org.onebusaway.geospatial.model.CoordinatePoint


          record.setDistanceAlongBlock(blockLocation.getDistanceAlongBlock());

        if (blockLocation.isScheduleDeviationSet())
          record.setScheduleDeviation(blockLocation.getScheduleDeviation());

        CoordinatePoint p = blockLocation.getLocation();
        if (p != null) {
          record.setVehicleLat(p.getLat());
          record.setVehicleLon(p.getLon());
        }
        record.setMatchedVehicleId(blockLocation.getVehicleId());
      }
    }
View Full Code Here


    CoordinateBounds bounds = queryBean.getBounds();
    String query = queryBean.getQuery();
    int maxCount = queryBean.getMaxCount();

    CoordinatePoint center = SphericalGeometryLibrary.getCenterOfBounds(bounds);

    SearchResult<AgencyAndId> stops;
    try {
      stops = _searchService.searchForStopsByCode(query, 10, MIN_SCORE);
    } catch (ParseException e) {
      throw new InvalidArgumentServiceException("query", "queryParseError");
    } catch (IOException e) {
      _log.error("error executing stop search: query=" + query, e);
      e.printStackTrace();
      throw new ServiceException();
    }

    Min<StopBean> closest = new Min<StopBean>();
    List<StopBean> stopBeans = new ArrayList<StopBean>();

    for (AgencyAndId aid : stops.getResults()) {
      StopBean stopBean = _stopBeanService.getStopForId(aid);
      if (bounds.contains(stopBean.getLat(), stopBean.getLon()))
        stopBeans.add(stopBean);
      double distance = SphericalGeometryLibrary.distance(center.getLat(),
          center.getLon(), stopBean.getLat(), stopBean.getLon());
      closest.add(distance, stopBean);
    }

    boolean limitExceeded = BeanServiceSupport.checkLimitExceeded(stopBeans,
        maxCount);
View Full Code Here

        options);
  }

  private LocationBean getPointAsLocation(TransitLocationBean p) {
    LocationBean bean = new LocationBean();
    bean.setLocation(new CoordinatePoint(p.getLat(), p.getLon()));
    return bean;
  }
View Full Code Here

      fromStop = builder.getFromStop().getBlockStopTime();

    if (builder.getToStop() != null)
      toStop = builder.getToStop().getBlockStopTime();

    CoordinatePoint nextPoint = null;

    BlockTripEntry nextBlockTrip = builder.getNextTrip();
    if (nextBlockTrip != null) {
      TripEntry nextTrip = nextBlockTrip.getTrip();
      AgencyAndId nextShapeId = nextTrip.getShapeId();
View Full Code Here

    double totalDistance = 0.0;

    long startTime = 0;
    long endTime = 0;

    CoordinatePoint from = null;
    CoordinatePoint to = null;

    for (State state : streetStates) {

      EdgeNarrative edgeResult = state.getBackEdgeNarrative();
View Full Code Here

      for (int i = 0; i < ls.getNumPoints(); i++) {
        if (i == 0 && !includeFirstPoint)
          continue;

        Coordinate c = ls.getCoordinateN(i);
        CoordinatePoint p = new CoordinatePoint(c.y, c.x);
        path.add(p);
      }
    } else {
      throw new IllegalStateException("unknown geometry: " + geom);
    }
View Full Code Here

      } else if (isStreetLeg(leg)) {

        Date time = new Date(targetTime);

        CoordinatePoint walkFrom = leg.getFrom();
        CoordinatePoint walkTo = leg.getTo();

        /**
         * Adjust the start and end locations for walk-legs to match the query
         * points. This is a hack, since it allows the client to pass in the
         * original unmodified itinerary from a previous to call, but also
View Full Code Here

    if (bean == null) {

      bean = new VertexBean();
      bean.setId(vertex.getLabel());
      bean.setLocation(new CoordinatePoint(vertex.getY(), vertex.getX()));

      Map<String, Object> tags = new HashMap<String, Object>();

      tags.put("class", vertex.getClass().getName());
View Full Code Here

    for (BlockLocation location : locations) {

      Date t = new Date(location.getTime());
      Record record = recordsByTime.get(t);

      CoordinatePoint userLocation = record.getLocation();
      CoordinatePoint vehicleLocation = location.getLocation();

      double d = SphericalGeometryLibrary.distance(userLocation,
          vehicleLocation);

      double p = _realTimeLocationDeviationModel.probability(d);
View Full Code Here

import org.onebusaway.transit_data_federation.model.ProjectedPoint;

public class ProjectedPointFactory {

  public static ProjectedPoint forward(double lat, double lon) {
    return forward(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.