Package org.onebusaway.geospatial.model

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


    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

    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

      count++;
    }

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

    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

  public DefaultHttpHeaders show() {

    if (hasErrors())
      return setValidationErrorsResponse();

    EncodedPolylineBean shape = _service.getShapeForId(_id);

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

    BeanFactoryV2 factory = getBeanFactoryV2();
View Full Code Here

        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

TOP

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

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.