function isConnectedViaOtherTypes()

in modules/validations/impossible_oneway.js [58:102]


        function isConnectedViaOtherTypes(way, node) {

            var wayType = typeForWay(way);

            if (wayType === 'highway') {
                // entrances are considered connected
                if (node.tags.entrance && node.tags.entrance !== 'no') return true;
                if (node.tags.amenity === 'parking_entrance') return true;
            } else if (wayType === 'waterway') {
                if (node.id === way.first()) {
                    // multiple waterways may start at the same spring
                    if (node.tags.natural === 'spring') return true;
                } else {
                    // multiple waterways may end at the same drain
                    if (node.tags.manhole === 'drain') return true;
                }
            }

            return graph.parentWays(node).some(function(parentWay) {
                if (parentWay.id === way.id) return false;

                if (wayType === 'highway') {

                    // allow connections to highway areas
                    if (parentWay.geometry(graph) === 'area' &&
                        osmRoutableHighwayTagValues[parentWay.tags.highway]) return true;

                    // count connections to ferry routes as connected
                    if (parentWay.tags.route === 'ferry') return true;

                    return graph.parentRelations(parentWay).some(function(parentRelation) {
                        if (parentRelation.tags.type === 'route' &&
                            parentRelation.tags.route === 'ferry') return true;

                        // allow connections to highway multipolygons
                        return parentRelation.isMultipolygon() && osmRoutableHighwayTagValues[parentRelation.tags.highway];
                    });
                } else if (wayType === 'waterway') {
                    // multiple waterways may start or end at a water body at the same node
                    if (parentWay.tags.natural === 'water' ||
                        parentWay.tags.natural === 'coastline') return true;
                }
                return false;
            });
        }