Class ReverseWayNoTagCorrector
- java.lang.Object
-
- org.openstreetmap.josm.actions.corrector.ReverseWayNoTagCorrector
-
public final class ReverseWayNoTagCorrector extends Object
A ReverseWayNoTagCorrector warns about ways that should not be reversed because their semantic meaning cannot be preserved in that case. E.g. natural=coastline, natural=cliff, barrier=retaining_wall cannot be changed.- Since:
- 5724
- See Also:
for handling of tags that can be modified (oneway=yes, etc.)
-
-
Field Summary
Fields Modifier and Type Field Description private static TagCollection
DIRECTIONAL_TAGS
Tags that imply a semantic meaning from the way direction and cannot be changed.
-
Constructor Summary
Constructors Modifier Constructor Description private
ReverseWayNoTagCorrector()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkAndConfirmReverseWay(Way way)
Checks the given way can be safely reversed and asks user to confirm the operation if it not the case.private static boolean
confirmReverseWay(Way way, TagCollection tags)
static TagCollection
getDirectionalTags(Tagged way)
Replies the tags that imply a semantic meaning fromway
direction and cannot be changed.static boolean
isReversible(Tagged way)
Tests whether way can be reversed without semantic change.
-
-
-
Field Detail
-
DIRECTIONAL_TAGS
private static final TagCollection DIRECTIONAL_TAGS
Tags that imply a semantic meaning from the way direction and cannot be changed.
-
-
Constructor Detail
-
ReverseWayNoTagCorrector
private ReverseWayNoTagCorrector()
-
-
Method Detail
-
getDirectionalTags
public static TagCollection getDirectionalTags(Tagged way)
Replies the tags that imply a semantic meaning fromway
direction and cannot be changed.- Parameters:
way
- The way to look for- Returns:
- tags that imply a semantic meaning from
way
direction and cannot be changed
-
isReversible
public static boolean isReversible(Tagged way)
Tests whether way can be reversed without semantic change. Looks for tags like natural=cliff, barrier=retaining_wall.- Parameters:
way
- The way to check- Returns:
- false if the semantic meaning change if the way is reversed, true otherwise.
-
confirmReverseWay
private static boolean confirmReverseWay(Way way, TagCollection tags)
-
checkAndConfirmReverseWay
public static void checkAndConfirmReverseWay(Way way) throws UserCancelException
Checks the given way can be safely reversed and asks user to confirm the operation if it not the case.- Parameters:
way
- The way to check- Throws:
UserCancelException
- If the user cancels the operation
-
-