Package org.opentripplanner.routing.edgetype

Examples of org.opentripplanner.routing.edgetype.StreetTraversalPermission


     * Handler for a new Area (single way area or multipolygon relations)
     *
     * @param area
     */
    private void newArea(Area area) {
        StreetTraversalPermission permissions = OSMFilter.getPermissionsForEntity(area.parent,
                StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE);
        if (OSMFilter.isOsmEntityRoutable(area.parent)
                && permissions != StreetTraversalPermission.NONE) {
            walkableAreas.add(area);
        }
View Full Code Here


        // do we need to recurse?
        if (intersects.size() == 1) {
            Area area = intersects.get(0);
            OSMWithTags areaEntity = area.parent;

            StreetTraversalPermission areaPermissions = OSMFilter.getPermissionsForEntity(
                    areaEntity, StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE);

            float carSpeed = wayPropertySet.getCarSpeedForWay(areaEntity, false);

            double length = distanceLibrary.distance(startEndpoint.getCoordinate(),
View Full Code Here

            Double safety = wayData.getSafetyFeatures().first;
            namedArea.setBicycleSafetyMultiplier(safety);

            namedArea.setOriginalEdges(intersection);

            StreetTraversalPermission permission = OSMFilter.getPermissionsForEntity(areaEntity,
                    StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE);
            namedArea.setPermission(permission);

            edgeList.addArea(namedArea);
        }
View Full Code Here

            if (edgeEndpoints.contains(endpoints)) {
                assertFalse(true);
            }
            edgeEndpoints.add(endpoints);
           
            StreetTraversalPermission perm = se.getPermission();
           
            // CAR and CUSTOM_MOTOR_VEHICLE should always have the same permissions.
            assertEquals(perm.allows(StreetTraversalPermission.CAR),
                    perm.allows(StreetTraversalPermission.CUSTOM_MOTOR_VEHICLE));

            // Check turn restriction consistency.
            // NOTE(flamholz): currently there don't appear to be any turn restrictions
            // in the OSM file we are loading.
            for (TurnRestriction tr : gg.getTurnRestrictions(se)) {
View Full Code Here

                WayProperties wayData = wayPropertySet.getDataForWay(way);

                setWayName(way);

                StreetTraversalPermission permissions = OSMFilter.getPermissionsForWay(way,
                        wayData.getPermission(), graph);
                if (!OSMFilter.isWayRoutable(way) || permissions.allowsNothing())
                    continue;

                // handle duplicate nodes in OSM ways
                // this is a workaround for crappy OSM data quality
                ArrayList<Long> nodes = new ArrayList<Long>(way.getNodeRefs().size());
View Full Code Here

                    Vertex from = onboardVertices.get(i);
                    Vertex to = onboardVertices.get(i + 1);

                    // default permissions: pedestrian, wheelchair, and bicycle
                    boolean wheelchairAccessible = true;
                    StreetTraversalPermission permission = StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE;
                    // check for bicycle=no, otherwise assume it's OK to take a bike
                    if (node.isTagFalse("bicycle")) {
                        permission = StreetTraversalPermission.PEDESTRIAN;
                    }
                    // check for wheelchair=no
View Full Code Here

            StreetEdge street = null, backStreet = null;
            double length = this.getGeometryLengthMeters(geometry);

            P2<StreetTraversalPermission> permissionPair = OSMFilter.getPermissions(permissions,
                    way);
            StreetTraversalPermission permissionsFront = permissionPair.first;
            StreetTraversalPermission permissionsBack = permissionPair.second;

            if (permissionsFront.allowsAnything()) {
                street = getEdgeForStreet(start, end, way, index, startNode, endNode, length,
                        permissionsFront, geometry, false);
            }
            if (permissionsBack.allowsAnything()) {
                backStreet = getEdgeForStreet(end, start, way, index, endNode, startNode, length,
                        permissionsBack, backGeometry, true);
            }
            if (street != null && backStreet != null) {
                backStreet.shareData(street);
View Full Code Here

            String perms = entry.getValue();
            String[] tokens = perms.split(",");
            if (tokens.length != 2)
                throw new IllegalArgumentException("invalid street traversal permissions: " + perms);

            StreetTraversalPermission forward = StreetTraversalPermission.valueOf(tokens[0]);
            StreetTraversalPermission reverse = StreetTraversalPermission.valueOf(tokens[1]);
            addPermission(attributeValue, forward, reverse);
        }
    }
View Full Code Here

        for (SimpleFeatureConverter<P2<StreetTraversalPermission>> converter : converters) {
            P2<StreetTraversalPermission> value = converter.convert(feature);
            if (result == null) {
                result = value;
            } else {
                StreetTraversalPermission first, second;
                if (orPermissions) {
                    first = result.first.add(value.first);
                    second = result.second.add(value.second);
                } else {
                    first = StreetTraversalPermission.get(result.first.code & value.first.code);
View Full Code Here

                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);
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.edgetype.StreetTraversalPermission

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.