Class ConnectivityRelations

    • Method Detail

      • parseConnectivityTag

        public static java.util.Map<java.lang.Integer,​java.util.Map<java.lang.Integer,​java.lang.Boolean>> parseConnectivityTag​(Relation relation)
        Convert the connectivity tag into a map of values
        Parameters:
        relation - A relation with a connectivity tag.
        Returns:
        A Map in the form of Map<Lane From, Map<Lane To, Optional>> May contain nulls when errors are encountered, empty collection if connectivity tag contains unusual values
      • checkForInconsistentLanes

        private java.util.Map<java.lang.String,​java.lang.Integer> checkForInconsistentLanes​(Relation relation,
                                                                                                  java.util.Map<java.lang.Integer,​java.util.Map<java.lang.Integer,​java.lang.Boolean>> connTagLanes)
        Compare lane tags of members to values in the connectivity tag of the relation
        Parameters:
        relation - A relation with a connectivity tag.
        connTagLanes - result of parseConnectivityTag(Relation)
        Returns:
        A Map in the form of Map<Role, Lane Count>
      • checkForImpliedConnectivity

        private void checkForImpliedConnectivity​(Relation relation,
                                                 java.util.Map<java.lang.String,​java.lang.Integer> roleLanes,
                                                 java.util.Map<java.lang.Integer,​java.util.Map<java.lang.Integer,​java.lang.Boolean>> connTagLanes)
        Check the relation to see if the connectivity described is already implied by other data
        Parameters:
        relation - A relation with a connectivity tag.
        roleLanes - The lane counts for each relation role
        connTagLanes - result of parseConnectivityTag(Relation)
      • checkForIntersectionAtMembers

        private static boolean checkForIntersectionAtMembers​(Relation relation)
        Check to see if there is an intersection present at the via member
        Parameters:
        relation - A relation with a connectivity tag.
        Returns:
        A Boolean that indicates whether an intersection is present at the via member
      • checkMemberTagsForImpliedConnectivity

        private static boolean checkMemberTagsForImpliedConnectivity​(Relation relation,
                                                                     java.util.Map<java.lang.String,​java.lang.Integer> roleLanes)
        Check the relation to see if the connectivity described is already implied by the relation members' tags
        Parameters:
        relation - A relation with a connectivity tag.
        roleLanes - The lane counts for each relation role
        Returns:
        Whether connectivity is already implied by tags on relation members
      • checkForBadRole

        private boolean checkForBadRole​(Relation relation)
        Check if the roles of the relation are appropriate
        Parameters:
        relation - A relation with a connectivity tag.
        Returns:
        Whether one or more of the relation's members has an unusual role
      • checkForMissingRole

        private static boolean checkForMissingRole​(Relation relation)
        Check if the relation contains all necessary roles
        Parameters:
        relation - A relation with a connectivity tag.
        Returns:
        Whether the relation is missing one or more of the critical from, via, or to roles
      • mixedViaNodeAndWay

        private boolean mixedViaNodeAndWay​(Relation relation,
                                           int viaWays,
                                           int viaNodes)
        Check if the relation's roles are on appropriate objects
        Parameters:
        relation - A relation with a connectivity tag.
        viaWays - The number of ways in the relation with the via role
        viaNodes - The number of nodes in the relation with the via role
        Returns:
        Whether the relation is missing one or more of the critical 'from', 'via', or 'to' roles