Examples of EncodedPolylineBean


Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

        -122.3, -122.27878118907307, -122.27342376951559, -122.2735240417865,
        -122.4};

    String expected = "}d_bHlqiiVKo`@sUR";

    EncodedPolylineBean actual = PolylineEncoder.createEncodings(lat, lon, 1,
        3, 0);
    Assert.assertEquals(expected, actual.getPoints());
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    return beans;
  }

  protected EncodedPolygonBean getBoundaryAsPolygonBean(Boundary boundary) {
    EncodedPolygonBean bean = new EncodedPolygonBean();
    EncodedPolylineBean outerRing = getPathAsEncodedPath(boundary.getOuterBoundary());
    bean.setOuterRing(outerRing);
    for (BoundaryPath path : boundary.getInnerBoundaries()) {
      EncodedPolylineBean innerRing = getPathAsEncodedPath(path);
      bean.addInnerRing(innerRing);
    }
    return bean;
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

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

    for (Map.Entry<Integer, List<EncodedPolygonBean>> entry : polygonsByTime.entrySet()) {
      System.out.println("t=" + entry.getKey());
      for (EncodedPolygonBean bean : entry.getValue()) {
        EncodedPolylineBean outerRing = bean.getOuterRing();
        System.out.println(outerRing.getPoints() + " " + outerRing.getLength());
      }
    }
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

      count++;
    }

    String pointsString = encodedPoints.toString();
    String levelsString = level >= 0 ? encodedLevels.toString() : null;
    return new EncodedPolylineBean(pointsString, levelsString, count);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

    if (_includeConditionDetails
        && (consequence.getDetourPath() != null || !CollectionsLibrary.isEmpty(consequence.getDetourStopIds()))) {
      SituationConditionDetailsV2Bean detailsBean = new SituationConditionDetailsV2Bean();
      if (consequence.getDetourPath() != null) {
        EncodedPolylineBean poly = new EncodedPolylineBean();
        poly.setPoints(consequence.getDetourPath());
        detailsBean.setDiversionPath(poly);
      }
      detailsBean.setDiversionStopIds(consequence.getDetourStopIds());
      bean.setConditionDetails(detailsBean);
    }
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

  public DefaultHttpHeaders show() {

    if (hasErrors())
      return setValidationErrorsResponse();

    EncodedPolylineBean shape = _service.getShapeForId(_id);

    if (shape == null)
      return setResourceNotFoundResponse();

    BeanFactoryV2 factory = getBeanFactoryV2();
View Full Code Here

Examples of org.onebusaway.geospatial.model.EncodedPolylineBean

        String path = leg.getPath();

        if (path != null) {

          List<CoordinatePoint> points = PolylineEncoder.decode(path);
          EncodedPolylineBean bean = PolylineEncoder.createEncodings(points);
         
          Polyline line = getPathAsPolyline(bean);
          PolyStyleOptions style = PolyStyleOptions.newInstance("#0000FF", 4,
              0.5);
          line.setStrokeStyle(style);
          resultingOverlays.add(line);

          addBoundsToBounds(line.getBounds(), bounds);
        }

        StopBean stop = leg.getFromStop();

        if (stop != null) {
          String routeName = leg.getRouteShortName();

          TripPlannerResources resources = TripPlannerResources.INSTANCE;
          SpanPanel w = new SpanPanel();
          w.addStyleName(_css.routeTinyInfoWindow());
          Image image = new Image(resources.getBus14x14().getUrl());
          image.addStyleName(_css.routeModeIcon());
          w.add(image);
          SpanWidget name = new SpanWidget(routeName);
          name.setStyleName(_css.routeName());
          w.add(name);

          LatLng point = LatLng.newInstance(stop.getLat(), stop.getLon());
          TinyInfoWindowMarker marker = new TinyInfoWindowMarker(point, w);
          resultingOverlays.add(marker);

          bounds.extend(point);
        }
      } else if (mode.equals("walk")) {
        List<StreetLegBean> streetLegs = segment.getStreetLegs();
        List<CoordinatePoint> allPoints = new ArrayList<CoordinatePoint>();
        for (StreetLegBean streetLeg : streetLegs) {
          String path = streetLeg.getPath();
          List<CoordinatePoint> points = PolylineEncoder.decode(path);
          allPoints.addAll(points);
        }
        EncodedPolylineBean polyline = PolylineEncoder.createEncodings(allPoints);
        Polyline line = getPathAsPolyline(polyline);
        PolyStyleOptions style = PolyStyleOptions.newInstance("#000000", 4, 0.8);
        line.setStrokeStyle(style);
        resultingOverlays.add(line);
View Full Code Here

Examples of org.opentripplanner.util.model.EncodedPolylineBean

            count++;
        }

        String pointsString = encodedPoints.toString();
        String levelsString = level >= 0 ? encodedLevels.toString() : null;
        return new EncodedPolylineBean(pointsString, levelsString, count);
    }
View Full Code Here

Examples of org.opentripplanner.util.model.EncodedPolylineBean

        // test taken from example usage
        List<Coordinate> points = new ArrayList<Coordinate>();
        points.add(new Coordinate(-73.85062, 40.903125, Double.NaN));
        points.add(new Coordinate(-73.85136, 40.902261, Double.NaN));
        points.add(new Coordinate(-73.85151, 40.902066, Double.NaN));
        EncodedPolylineBean eplb = PolylineEncoder.createEncodings(points);
        assertEquals("o{sxFl}vaMjDpCf@\\", eplb.getPoints());
        assertEquals(3, eplb.getLength());
        assertNull(eplb.getLevels());
    }
View Full Code Here

Examples of org.opentripplanner.util.model.EncodedPolylineBean

public class TestEncodedPolylineBean extends TestCase {

    public void testEncodedPolylineBean() {
        // test taken from an example usage
        EncodedPolylineBean eplb = new EncodedPolylineBean("wovwF|`pbMgPzg@CHEHCFEFCFEFEFEDGDEDEDGBEBGDG@", null, 17);
        assertEquals("wovwF|`pbMgPzg@CHEHCFEFCFEFEFEDGDEDEDGBEBGDG@", eplb.getPoints());
        assertNull(eplb.getLevels());
        assertEquals(17, eplb.getLength());
    }
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.