Examples of EncodedPolylineBean


Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

  public static String getFullPath(ShapePoints shapePoints,
      CoordinatePoint nextPoint) {

    if (nextPoint == null) {
      EncodedPolylineBean bean = PolylineEncoder.createEncodings(
          shapePoints.getLats(), shapePoints.getLons());
      return bean.getPoints();
    } else {
      int n = shapePoints.getSize() + 1;
      double[] lats = new double[n];
      double[] lons = new double[n];
      System.arraycopy(shapePoints.getLats(), 0, lats, 0, n - 1);
      System.arraycopy(shapePoints.getLons(), 0, lons, 0, n - 1);
      lats[n - 1] = nextPoint.getLat();
      lons[n - 1] = nextPoint.getLon();
      EncodedPolylineBean bean = PolylineEncoder.createEncodings(lats, lons);
      return bean.getPoints();
    }
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    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

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

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

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

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    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

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

            Geometry geom = narrative.getGeometry();
            if (geom != null) {
              List<CoordinatePoint> path = new ArrayList<CoordinatePoint>();
              appendGeometryToPath(geom, path, true);
              EncodedPolylineBean polyline = PolylineEncoder.createEncodings(path);
              narrativeBean.setPath(polyline.getPoints());
            }

            narrativeBean.setFrom(from);
            narrativeBean.setTo(getVertexAsBean(beansByVertex,
                narrative.getToVertex()));
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

  }

  private void addPathToStreetLegIfApplicable(StreetLegBean streetLeg,
      List<CoordinatePoint> path, double distance) {
    if (streetLeg != null) {
      EncodedPolylineBean polyline = PolylineEncoder.createEncodings(path);
      streetLeg.setPath(polyline.getPoints());
      streetLeg.setDistance(distance);
    }
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    Set<AgencyAndId> shapeIds = new HashSet<AgencyAndId>();
    shapeIds.add(shapeId);
    tripA.setShapeId(shapeId);

    EncodedPolylineBean polyline = new EncodedPolylineBean();
    Mockito.when(_shapeBeanService.getMergedPolylinesForShapeIds(shapeIds)).thenReturn(
        Arrays.asList(polyline));

    // Setup complete
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    points.add(new CoordinatePoint(40.7, -120.95));
    points.add(new CoordinatePoint(43.252, -126.453));

    String expected = "_p~iF~ps|U_ulLnnqC_mqNvxq`@";

    EncodedPolylineBean actual = PolylineEncoder.createEncodings(points, 0);
    Assert.assertEquals(expected, actual.getPoints());

    List<CoordinatePoint> decodedPoints = PolylineEncoder.decode(actual);
    GeospatialTestSupport.assertEqualsPointLists(points, decodedPoints, 1e-5);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    points.add(new CoordinatePoint(47.67845871865856, -122.27342376951559));
    points.add(new CoordinatePoint(47.682076843204875, -122.2735240417865));

    String expected = "}d_bHlqiiVKo`@sUR";

    EncodedPolylineBean actual = PolylineEncoder.createEncodings(points, 0);
    Assert.assertEquals(expected, actual.getPoints());

    List<CoordinatePoint> decodedPoints = PolylineEncoder.decode(actual);
    GeospatialTestSupport.assertEqualsPointLists(points, decodedPoints, 1e-5);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    double[] lon = {
        -122.27878118907307, -122.27342376951559, -122.2735240417865};

    String expected = "}d_bHlqiiVKo`@sUR";

    EncodedPolylineBean actual = PolylineEncoder.createEncodings(lat, lon, 0);
    Assert.assertEquals(expected, actual.getPoints());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.