Examples of EdgeNarrativeBean


Examples of org.onebusaway.transit_data.model.tripplanning.EdgeNarrativeBean

        List<EdgeNarrativeBean> edgeNarratives = new ArrayList<EdgeNarrativeBean>();

        for (Edge edge : edges) {
          if (edge instanceof EdgeNarrative) {
            EdgeNarrative narrative = (EdgeNarrative) edge;
            EdgeNarrativeBean narrativeBean = new EdgeNarrativeBean();
            narrativeBean.setName(narrative.getName());

            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()));

            Map<String, Object> tags = new HashMap<String, Object>();
            if (edge instanceof StreetEdge) {
              StreetEdge streetEdge = (StreetEdge) edge;
              StreetTraversalPermission permission = streetEdge.getPermission();
              if (permission != null)
                tags.put("access", permission.toString().toLowerCase());
            }

            if (!tags.isEmpty())
              narrativeBean.setTags(tags);

            edgeNarratives.add(narrativeBean);
          }
        }
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.