diff --git a/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java b/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java index c6f775e588f..06256a64572 100644 --- a/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java +++ b/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java @@ -15,7 +15,7 @@ import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.calendar.openinghours.OHCalendar; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; -import org.opentripplanner.openstreetmap.OSMOpeningHoursParser; +import org.opentripplanner.openstreetmap.OsmOpeningHoursParser; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; @@ -36,7 +36,7 @@ abstract class ParkAPIUpdater extends GenericJsonDataSource { private final String feedId; private final Collection staticTags; - private final OSMOpeningHoursParser osmOpeningHoursParser; + private final OsmOpeningHoursParser osmOpeningHoursParser; private final String url; public ParkAPIUpdater( @@ -47,7 +47,7 @@ public ParkAPIUpdater( this.feedId = parameters.feedId(); this.staticTags = parameters.tags(); this.osmOpeningHoursParser = - new OSMOpeningHoursParser(openingHoursCalendarService, parameters.timeZone()); + new OsmOpeningHoursParser(openingHoursCalendarService, parameters.timeZone()); this.url = parameters.url(); } diff --git a/src/main/java/org/opentripplanner/graph_builder/issues/DisconnectedOsmNode.java b/src/main/java/org/opentripplanner/graph_builder/issues/DisconnectedOsmNode.java index f1c341a46fe..f92baf11c19 100644 --- a/src/main/java/org/opentripplanner/graph_builder/issues/DisconnectedOsmNode.java +++ b/src/main/java/org/opentripplanner/graph_builder/issues/DisconnectedOsmNode.java @@ -3,10 +3,10 @@ import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWithTags; -public record DisconnectedOsmNode(OSMNode node, OSMWithTags way, OSMWithTags area) +public record DisconnectedOsmNode(OsmNode node, OsmWithTags way, OsmWithTags area) implements DataImportIssue { private static final String FMT = "Node %s in way %s is coincident but disconnected with area %s"; private static final String HTMLFMT = diff --git a/src/main/java/org/opentripplanner/graph_builder/issues/InvalidOsmGeometry.java b/src/main/java/org/opentripplanner/graph_builder/issues/InvalidOsmGeometry.java index 7f84453a6d8..3540b5b81c3 100644 --- a/src/main/java/org/opentripplanner/graph_builder/issues/InvalidOsmGeometry.java +++ b/src/main/java/org/opentripplanner/graph_builder/issues/InvalidOsmGeometry.java @@ -1,9 +1,9 @@ package org.opentripplanner.graph_builder.issues; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; -public record InvalidOsmGeometry(OSMWithTags entity) implements DataImportIssue { +public record InvalidOsmGeometry(OsmWithTags entity) implements DataImportIssue { private static final String FMT = "Invalid OSM geometry %s"; private static final String HTMLFMT = "Invalid OSM geometry '%s'"; diff --git a/src/main/java/org/opentripplanner/graph_builder/issues/InvalidVehicleParkingCapacity.java b/src/main/java/org/opentripplanner/graph_builder/issues/InvalidVehicleParkingCapacity.java index c4f5498a769..d49c2497f76 100644 --- a/src/main/java/org/opentripplanner/graph_builder/issues/InvalidVehicleParkingCapacity.java +++ b/src/main/java/org/opentripplanner/graph_builder/issues/InvalidVehicleParkingCapacity.java @@ -1,9 +1,9 @@ package org.opentripplanner.graph_builder.issues; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; -public record InvalidVehicleParkingCapacity(OSMWithTags entity, String capacityValue) +public record InvalidVehicleParkingCapacity(OsmWithTags entity, String capacityValue) implements DataImportIssue { private static final String FMT = "Capacity for osm node %d is not a number: '%s'; it's replaced with '-1' (unknown)."; diff --git a/src/main/java/org/opentripplanner/graph_builder/issues/LevelAmbiguous.java b/src/main/java/org/opentripplanner/graph_builder/issues/LevelAmbiguous.java index 650c8b299ac..5c438f9dc5b 100644 --- a/src/main/java/org/opentripplanner/graph_builder/issues/LevelAmbiguous.java +++ b/src/main/java/org/opentripplanner/graph_builder/issues/LevelAmbiguous.java @@ -1,9 +1,9 @@ package org.opentripplanner.graph_builder.issues; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; -public record LevelAmbiguous(String layerName, OSMWithTags entity) implements DataImportIssue { +public record LevelAmbiguous(String layerName, OsmWithTags entity) implements DataImportIssue { private static final String FMT = "Could not infer floor number for layer called '%s' at %s. " + "Vertical movement will still be possible, but elevator cost might be incorrect. " + diff --git a/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideUnlinked.java b/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideUnlinked.java index 7da16a2891f..2cdf0ce6398 100644 --- a/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideUnlinked.java +++ b/src/main/java/org/opentripplanner/graph_builder/issues/ParkAndRideUnlinked.java @@ -1,9 +1,9 @@ package org.opentripplanner.graph_builder.issues; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; -public record ParkAndRideUnlinked(String name, OSMWithTags entity) implements DataImportIssue { +public record ParkAndRideUnlinked(String name, OsmWithTags entity) implements DataImportIssue { private static final String FMT = "Park and ride '%s' (%s) not linked to any streets in OSM; entrance might not be placed correctly."; private static final String HTMLFMT = diff --git a/src/main/java/org/opentripplanner/graph_builder/issues/TurnRestrictionUnknown.java b/src/main/java/org/opentripplanner/graph_builder/issues/TurnRestrictionUnknown.java index 36e913cba6a..ae509444c79 100644 --- a/src/main/java/org/opentripplanner/graph_builder/issues/TurnRestrictionUnknown.java +++ b/src/main/java/org/opentripplanner/graph_builder/issues/TurnRestrictionUnknown.java @@ -1,9 +1,9 @@ package org.opentripplanner.graph_builder.issues; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; -public record TurnRestrictionUnknown(OSMWithTags entity, String tagval) implements DataImportIssue { +public record TurnRestrictionUnknown(OsmWithTags entity, String tagval) implements DataImportIssue { private static final String FMT = "Invalid turn restriction tag %s in turn restriction %d"; private static final String HTMLFMT = "Invalid turn restriction tag %s in '%s'"; diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/Area.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/Area.java index f0a61e94c5a..e823fe2de6f 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/Area.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/Area.java @@ -12,9 +12,9 @@ import org.locationtech.jts.geom.Polygon; import org.locationtech.jts.geom.TopologyException; import org.opentripplanner.framework.geometry.GeometryUtils; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * Stores information about an OSM area needed for visibility graph construction. Algorithm based on @@ -25,14 +25,14 @@ class Area { final List outermostRings; // This is the way or relation that has the relevant tags for the area - final OSMWithTags parent; + final OsmWithTags parent; public MultiPolygon jtsMultiPolygon; Area( - OSMWithTags parent, - List outerRingWays, - List innerRingWays, - TLongObjectMap nodes + OsmWithTags parent, + List outerRingWays, + List innerRingWays, + TLongObjectMap nodes ) { this.parent = parent; // ring assignment @@ -84,7 +84,7 @@ class Area { jtsMultiPolygon = calculateJTSMultiPolygon(); } - public List constructRings(List ways) { + public List constructRings(List ways) { if (ways.size() == 0) { // no rings is no rings return Collections.emptyList(); @@ -92,8 +92,8 @@ public List constructRings(List ways) { List closedRings = new ArrayList<>(); - ArrayListMultimap waysByEndpoint = ArrayListMultimap.create(); - for (OSMWay way : ways) { + ArrayListMultimap waysByEndpoint = ArrayListMultimap.create(); + for (OsmWay way : ways) { TLongList refs = way.getNodeRefs(); long start = refs.get(0); @@ -110,7 +110,7 @@ public List constructRings(List ways) { // Precheck for impossible situations, and remove those. TLongList endpointsToRemove = new TLongArrayList(); for (Long endpoint : waysByEndpoint.keySet()) { - Collection list = waysByEndpoint.get(endpoint); + Collection list = waysByEndpoint.get(endpoint); if (list.size() % 2 == 1) { endpointsToRemove.add(endpoint); } @@ -126,9 +126,9 @@ public List constructRings(List ways) { } long firstEndpoint = 0, otherEndpoint = 0; - OSMWay firstWay = null; + OsmWay firstWay = null; for (Long endpoint : waysByEndpoint.keySet()) { - List list = waysByEndpoint.get(endpoint); + List list = waysByEndpoint.get(endpoint); firstWay = list.get(0); TLongList nodeRefs = firstWay.getNodeRefs(); partialRing.addAll(nodeRefs); @@ -161,14 +161,14 @@ private MultiPolygon calculateJTSMultiPolygon() { } private boolean constructRingsRecursive( - ArrayListMultimap waysByEndpoint, + ArrayListMultimap waysByEndpoint, TLongList ring, List closedRings, long endpoint ) { - List ways = new ArrayList<>(waysByEndpoint.get(endpoint)); + List ways = new ArrayList<>(waysByEndpoint.get(endpoint)); - for (OSMWay way : ways) { + for (OsmWay way : ways) { // remove this way from the map TLongList nodeRefs = way.getNodeRefs(); long firstEndpoint = nodeRefs.get(0); @@ -200,9 +200,9 @@ private boolean constructRingsRecursive( // otherwise, we need to start a new partial ring newRing = new TLongArrayList(); - OSMWay firstWay = null; + OsmWay firstWay = null; for (Long entry : waysByEndpoint.keySet()) { - List list = waysByEndpoint.get(entry); + List list = waysByEndpoint.get(entry); firstWay = list.get(0); nodeRefs = firstWay.getNodeRefs(); newRing.addAll(nodeRefs); diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaGroup.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaGroup.java index a7bcc9ccb94..26bdf482893 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaGroup.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaGroup.java @@ -18,8 +18,8 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.graph_builder.module.osm.Ring.RingConstructionException; import org.opentripplanner.openstreetmap.model.OSMLevel; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,15 +51,15 @@ public AreaGroup(Collection areas) { List allRings = new ArrayList<>(); // However, JTS will lose the coord<->osmnode mapping, and we will have to reconstruct it. - HashMap nodeMap = new HashMap<>(); + HashMap nodeMap = new HashMap<>(); for (Area area : areas) { for (Ring ring : area.outermostRings) { allRings.add(ring.jtsPolygon); - for (OSMNode node : ring.nodes) { + for (OsmNode node : ring.nodes) { nodeMap.put(new Coordinate(node.lon, node.lat), node); } for (Ring inner : ring.getHoles()) { - for (OSMNode node : inner.nodes) { + for (OsmNode node : inner.nodes) { nodeMap.put(new Coordinate(node.lon, node.lat), node); } } @@ -88,22 +88,22 @@ public AreaGroup(Collection areas) { public static List groupAreas(Map areasLevels) { DisjointSet groups = new DisjointSet<>(); - Multimap areasForNode = LinkedListMultimap.create(); + Multimap areasForNode = LinkedListMultimap.create(); for (Area area : areasLevels.keySet()) { for (Ring ring : area.outermostRings) { for (Ring inner : ring.getHoles()) { - for (OSMNode node : inner.nodes) { + for (OsmNode node : inner.nodes) { areasForNode.put(node, area); } } - for (OSMNode node : ring.nodes) { + for (OsmNode node : ring.nodes) { areasForNode.put(node, area); } } } // areas that can be joined must share nodes and levels - for (OSMNode osmNode : areasForNode.keySet()) { + for (OsmNode osmNode : areasForNode.keySet()) { for (Area area1 : areasForNode.get(osmNode)) { OSMLevel level1 = areasLevels.get(area1); for (Area area2 : areasForNode.get(osmNode)) { @@ -133,14 +133,14 @@ public static List groupAreas(Map areasLevels) { return out; } - public OSMWithTags getSomeOSMObject() { + public OsmWithTags getSomeOSMObject() { return areas.iterator().next().parent; } - private Ring toRing(Polygon polygon, HashMap nodeMap) { - List shell = new ArrayList<>(); + private Ring toRing(Polygon polygon, HashMap nodeMap) { + List shell = new ArrayList<>(); for (Coordinate coord : polygon.getExteriorRing().getCoordinates()) { - OSMNode node = nodeMap.get(coord); + OsmNode node = nodeMap.get(coord); if (node == null) { throw new RingConstructionException(); } @@ -150,9 +150,9 @@ private Ring toRing(Polygon polygon, HashMap nodeMap) { // now the holes for (int i = 0; i < polygon.getNumInteriorRing(); ++i) { LineString interior = polygon.getInteriorRingN(i); - List hole = new ArrayList<>(); + List hole = new ArrayList<>(); for (Coordinate coord : interior.getCoordinates()) { - OSMNode node = nodeMap.get(coord); + OsmNode node = nodeMap.get(coord); if (node == null) { throw new RingConstructionException(); } diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaTooComplicated.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaTooComplicated.java index 65d03ba84ce..6fda454e0bc 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaTooComplicated.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/AreaTooComplicated.java @@ -2,7 +2,7 @@ import org.locationtech.jts.geom.Geometry; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; public record AreaTooComplicated(AreaGroup areaGroup, int nbNodes, int maxAreaNodes) implements DataImportIssue { @@ -16,7 +16,7 @@ public String getMessage() { @Override public String getHTMLMessage() { - OSMWithTags entity = areaGroup.getSomeOSMObject(); + OsmWithTags entity = areaGroup.getSomeOSMObject(); return String.format(HTMLFMT, entity.url(), entity.getId(), nbNodes, maxAreaNodes); } diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java index 57e1abdd2d3..cef2af9bf50 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/ElevatorProcessor.java @@ -11,9 +11,9 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issue.api.Issue; import org.opentripplanner.openstreetmap.model.OSMLevel; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.edge.ElevatorAlightEdge; @@ -57,7 +57,7 @@ public ElevatorProcessor( public void buildElevatorEdges(Graph graph) { /* build elevator edges */ for (Long nodeId : vertexGenerator.multiLevelNodes().keySet()) { - OSMNode node = osmdb.getNode(nodeId); + OsmNode node = osmdb.getNode(nodeId); // this allows skipping levels, e.g., an elevator that stops // at floor 0, 2, 3, and 5. // Converting to an Array allows us to @@ -107,10 +107,10 @@ public void buildElevatorEdges(Graph graph) { } // END elevator edge loop // Add highway=elevators to graph as elevators - Iterator elevators = osmdb.getWays().stream().filter(this::isElevatorWay).iterator(); + Iterator elevators = osmdb.getWays().stream().filter(this::isElevatorWay).iterator(); while (elevators.hasNext()) { - OSMWay elevatorWay = elevators.next(); + OsmWay elevatorWay = elevators.next(); List nodes = Arrays .stream(elevatorWay.getNodeRefs().toArray()) @@ -206,7 +206,7 @@ private static void createElevatorHopEdges( } } - private boolean isElevatorWay(OSMWay way) { + private boolean isElevatorWay(OsmWay way) { if (!way.isElevator()) { return false; } @@ -222,7 +222,7 @@ private boolean isElevatorWay(OSMWay way) { return nodeRefs.get(0) != nodeRefs.get(nodeRefs.size() - 1); } - private OptionalInt parseDuration(OSMWithTags element) { + private OptionalInt parseDuration(OsmWithTags element) { return element.getTagAsInt( "duration", v -> diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/EscalatorProcessor.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/EscalatorProcessor.java index 51cd230a1a4..74a65943a31 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/EscalatorProcessor.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/EscalatorProcessor.java @@ -3,7 +3,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import org.opentripplanner.openstreetmap.model.OSMWay; +import org.opentripplanner.openstreetmap.model.OsmWay; import org.opentripplanner.street.model.edge.EscalatorEdge; import org.opentripplanner.street.model.vertex.IntersectionVertex; @@ -18,7 +18,7 @@ public EscalatorProcessor(Map intersectionNodes) { this.intersectionNodes = intersectionNodes; } - public void buildEscalatorEdge(OSMWay escalatorWay, double length) { + public void buildEscalatorEdge(OsmWay escalatorWay, double length) { List nodes = Arrays .stream(escalatorWay.getNodeRefs().toArray()) .filter(nodeRef -> diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index 60525b3cb6c..dd89ce724c8 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -39,12 +39,12 @@ import org.opentripplanner.graph_builder.module.osm.TurnRestrictionTag.Direction; import org.opentripplanner.openstreetmap.model.OSMLevel; import org.opentripplanner.openstreetmap.model.OSMLevel.Source; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMRelation; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmRelation; import org.opentripplanner.openstreetmap.model.OSMRelationMember; -import org.opentripplanner.openstreetmap.model.OSMTag; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmTag; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.street.model.RepeatingTimePeriod; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.TurnRestrictionType; @@ -60,22 +60,22 @@ public class OsmDatabase { private final DataImportIssueStore issueStore; /* Map of all nodes used in ways/areas keyed by their OSM ID */ - private final TLongObjectMap nodesById = new TLongObjectHashMap<>(); + private final TLongObjectMap nodesById = new TLongObjectHashMap<>(); /* Map of all bike parking nodes, keyed by their OSM ID */ - private final TLongObjectMap bikeParkingNodes = new TLongObjectHashMap<>(); + private final TLongObjectMap bikeParkingNodes = new TLongObjectHashMap<>(); /* Map of all bike parking nodes, keyed by their OSM ID */ - private final TLongObjectMap carParkingNodes = new TLongObjectHashMap<>(); + private final TLongObjectMap carParkingNodes = new TLongObjectHashMap<>(); /* Map of all non-area ways keyed by their OSM ID */ - private final TLongObjectMap waysById = new TLongObjectHashMap<>(); + private final TLongObjectMap waysById = new TLongObjectHashMap<>(); /* Map of all area ways keyed by their OSM ID */ - private final TLongObjectMap areaWaysById = new TLongObjectHashMap<>(); + private final TLongObjectMap areaWaysById = new TLongObjectHashMap<>(); /* Map of all relations keyed by their OSM ID */ - private final TLongObjectMap relationsById = new TLongObjectHashMap<>(); + private final TLongObjectMap relationsById = new TLongObjectHashMap<>(); /* All walkable areas */ private final List walkableAreas = new ArrayList<>(); @@ -87,12 +87,12 @@ public class OsmDatabase { private final List bikeParkingAreas = new ArrayList<>(); /* Map of all area OSMWay for a given node */ - private final TLongObjectMap> areasForNode = new TLongObjectHashMap<>(); + private final TLongObjectMap> areasForNode = new TLongObjectHashMap<>(); /* Map of all area OSMWay for a given node */ - private final List singleWayAreas = new ArrayList<>(); + private final List singleWayAreas = new ArrayList<>(); - private final Set processedAreas = new HashSet<>(); + private final Set processedAreas = new HashSet<>(); /* Set of area way IDs */ private final TLongSet areaWayIds = new TLongHashSet(); @@ -104,7 +104,7 @@ public class OsmDatabase { private final TLongSet areaNodeIds = new TLongHashSet(); /* Track which vertical level each OSM way belongs to, for building elevators etc. */ - private final Map wayLevels = new HashMap<>(); + private final Map wayLevels = new HashMap<>(); /* Set of turn restrictions for each turn "from" way ID */ private final Multimap turnRestrictionsByFromWay = ArrayListMultimap.create(); @@ -116,7 +116,7 @@ public class OsmDatabase { * Map of all transit stop nodes that lie within an area and which are connected to the area by * a relation. Keyed by the area's OSM way. */ - private final Multimap stopsInAreas = HashMultimap.create(); + private final Multimap stopsInAreas = HashMultimap.create(); /* * ID of the next virtual node we create during building phase. Negative to prevent conflicts @@ -134,15 +134,15 @@ public OsmDatabase(DataImportIssueStore issueStore) { this.issueStore = issueStore; } - public OSMNode getNode(Long nodeId) { + public OsmNode getNode(Long nodeId) { return nodesById.get(nodeId); } - public OSMWay getWay(Long nodeId) { + public OsmWay getWay(Long nodeId) { return waysById.get(nodeId); } - public Collection getWays() { + public Collection getWays() { return Collections.unmodifiableCollection(waysById.valueCollection()); } @@ -158,11 +158,11 @@ public int wayCount() { return waysById.size(); } - public Collection getBikeParkingNodes() { + public Collection getBikeParkingNodes() { return Collections.unmodifiableCollection(bikeParkingNodes.valueCollection()); } - public Collection getCarParkingNodes() { + public Collection getCarParkingNodes() { return Collections.unmodifiableCollection(carParkingNodes.valueCollection()); } @@ -190,16 +190,16 @@ public Collection getToWayTurnRestrictions(Long toWayId) { return turnRestrictionsByToWay.get(toWayId); } - public Collection getStopsInArea(OSMWithTags areaParent) { + public Collection getStopsInArea(OsmWithTags areaParent) { return stopsInAreas.get(areaParent); } - public OSMLevel getLevelForWay(OSMWithTags way) { + public OSMLevel getLevelForWay(OsmWithTags way) { return Objects.requireNonNullElse(wayLevels.get(way), OSMLevel.DEFAULT); } - public Set getAreasForNode(Long nodeId) { - Set areas = areasForNode.get(nodeId); + public Set getAreasForNode(Long nodeId) { + Set areas = areasForNode.get(nodeId); if (areas == null) { return Set.of(); } @@ -210,7 +210,7 @@ public boolean isNodeBelongsToWay(Long nodeId) { return waysNodeIds.contains(nodeId); } - public void addNode(OSMNode node) { + public void addNode(OsmNode node) { if (node.isBikeParking()) { bikeParkingNodes.put(node.getId(), node); } @@ -233,7 +233,7 @@ public void addNode(OSMNode node) { nodesById.put(node.getId(), node); } - public void addWay(OSMWay way) { + public void addWay(OsmWay way) { /* only add ways once */ long wayId = way.getId(); if (waysById.containsKey(wayId) || areaWaysById.containsKey(wayId)) { @@ -277,7 +277,7 @@ public void addWay(OSMWay way) { waysById.put(wayId, way); } - public void addRelation(OSMRelation relation) { + public void addRelation(OsmRelation relation) { if (relationsById.containsKey(relation.getId())) { return; } @@ -350,14 +350,14 @@ public void postLoad() { /** * Check if a point is within an epsilon of a node. */ - private static boolean checkIntersectionDistance(Point p, OSMNode n, double epsilon) { + private static boolean checkIntersectionDistance(Point p, OsmNode n, double epsilon) { return Math.abs(p.getY() - n.lat) < epsilon && Math.abs(p.getX() - n.lon) < epsilon; } /** * Check if two nodes are within an epsilon. */ - private static boolean checkDistanceWithin(OSMNode a, OSMNode b, double epsilon) { + private static boolean checkDistanceWithin(OsmNode a, OsmNode b, double epsilon) { return Math.abs(a.lat - b.lat) < epsilon && Math.abs(a.lon - b.lon) < epsilon; } @@ -385,13 +385,13 @@ private void processUnconnectedAreas() { // For each way, intersect with areas int nCreatedNodes = 0; - for (OSMWay way : waysById.valueCollection()) { + for (OsmWay way : waysById.valueCollection()) { OSMLevel wayLevel = getLevelForWay(way); // For each segment of the way for (int i = 0; i < way.getNodeRefs().size() - 1; i++) { - OSMNode nA = nodesById.get(way.getNodeRefs().get(i)); - OSMNode nB = nodesById.get(way.getNodeRefs().get(i + 1)); + OsmNode nA = nodesById.get(way.getNodeRefs().get(i)); + OsmNode nB = nodesById.get(way.getNodeRefs().get(i + 1)); if (nA == null || nB == null) { continue; } @@ -455,7 +455,7 @@ private void processUnconnectedAreas() { // if the intersection is extremely close to one of the nodes of the road or the parking lot, just use that node // rather than splitting anything. See issue 1605. - OSMNode splitNode; + OsmNode splitNode; double epsilon = 0.0000001; // note that the if . . . else if structure of this means that if a node at one end of a (way|ring) segment is snapped, @@ -629,8 +629,8 @@ private void processAreaRingForUnconnectedAreas( * @param c The location of the node to create. * @return The created node. */ - private OSMNode createVirtualNode(Coordinate c) { - OSMNode node = new OSMNode(); + private OsmNode createVirtualNode(Coordinate c) { + OsmNode node = new OsmNode(); node.lon = c.x; node.lat = c.y; node.setId(virtualNodeId); @@ -640,7 +640,7 @@ private OSMNode createVirtualNode(Coordinate c) { return node; } - private void applyLevelsForWay(OSMWithTags way) { + private void applyLevelsForWay(OsmWithTags way) { /* Determine OSM level for each way, if it was not already set */ if (!wayLevels.containsKey(way)) { // if this way is not a key in the wayLevels map, a level map was not @@ -666,8 +666,8 @@ private void applyLevelsForWay(OSMWithTags way) { } } - private void markNodesForKeeping(Collection osmWays, TLongSet nodeSet) { - for (OSMWay way : osmWays) { + private void markNodesForKeeping(Collection osmWays, TLongSet nodeSet) { + for (OsmWay way : osmWays) { // Since the way is kept, update nodes-with-neighbors TLongList nodes = way.getNodeRefs(); if (nodes.size() > 1) { @@ -680,7 +680,7 @@ private void markNodesForKeeping(Collection osmWays, TLongSet nodeSet) { * Create areas from single ways. */ private void processSingleWayAreas() { - AREA:for (OSMWay way : singleWayAreas) { + AREA:for (OsmWay way : singleWayAreas) { if (processedAreas.contains(way)) { continue; } @@ -713,7 +713,7 @@ private void processSingleWayAreas() { * the used ways. */ private void processMultipolygonRelations() { - RELATION:for (OSMRelation relation : relationsById.valueCollection()) { + RELATION:for (OsmRelation relation : relationsById.valueCollection()) { if (processedAreas.contains(relation)) { continue; } @@ -726,10 +726,10 @@ private void processMultipolygonRelations() { continue; } // Area multipolygons -- pedestrian plazas - ArrayList innerWays = new ArrayList<>(); - ArrayList outerWays = new ArrayList<>(); + ArrayList innerWays = new ArrayList<>(); + ArrayList outerWays = new ArrayList<>(); for (OSMRelationMember member : relation.getMembers()) { - OSMWay way = areaWaysById.get(member.getRef()); + OsmWay way = areaWaysById.get(member.getRef()); if (way == null) { // relation includes way which does not exist in the data. Skip. continue RELATION; @@ -767,7 +767,7 @@ private void processMultipolygonRelations() { continue; } - OSMWithTags way = waysById.get(member.getRef()); + OsmWithTags way = waysById.get(member.getRef()); if (way == null) { continue; } @@ -812,7 +812,7 @@ private void newArea(Area area) { private void processRelations() { LOG.debug("Processing relations..."); - for (OSMRelation relation : relationsById.valueCollection()) { + for (OsmRelation relation : relationsById.valueCollection()) { if (relation.isRestriction()) { processRestriction(relation); } else if (relation.isLevelMap()) { @@ -830,7 +830,7 @@ private void processRelations() { * * @see "https://wiki.openstreetmap.org/wiki/Tag:route%3Dbicycle" */ - private void processBicycleRoute(OSMRelation relation) { + private void processBicycleRoute(OsmRelation relation) { if (relation.isBicycleRoute()) { // we treat networks without known network type like local networks var network = relation.getTagOpt("network").orElse("lcn"); @@ -838,7 +838,7 @@ private void processBicycleRoute(OSMRelation relation) { } } - private void setNetworkForAllMembers(OSMRelation relation, String key) { + private void setNetworkForAllMembers(OsmRelation relation, String key) { relation .getMembers() .forEach(member -> { @@ -855,7 +855,7 @@ private void setNetworkForAllMembers(OSMRelation relation, String key) { /** * Store turn restrictions. */ - private void processRestriction(OSMRelation relation) { + private void processRestriction(OsmRelation relation) { long from = -1, to = -1, via = -1; for (OSMRelationMember member : relation.getMembers()) { String role = member.getRole(); @@ -965,7 +965,7 @@ private void processRestriction(OSMRelation relation) { /** * Process an OSM level map. */ - private void processLevelMap(OSMRelation relation) { + private void processLevelMap(OsmRelation relation) { var levelsTag = relation.getTag("levels"); if (!StringUtils.hasValue(levelsTag)) { issueStore.add( @@ -987,7 +987,7 @@ private void processLevelMap(OSMRelation relation) { ); for (OSMRelationMember member : relation.getMembers()) { if (member.hasTypeWay() && waysById.containsKey(member.getRef())) { - OSMWay way = waysById.get(member.getRef()); + OsmWay way = waysById.get(member.getRef()); if (way != null) { String role = member.getRole(); // if the level map relation has a role:xyz tag, this way is something @@ -1007,13 +1007,13 @@ private void processLevelMap(OSMRelation relation) { /** * Handle route=road and route=bicycle relations. */ - private void processRoute(OSMRelation relation) { + private void processRoute(OsmRelation relation) { for (OSMRelationMember member : relation.getMembers()) { if (!(member.hasTypeWay() && waysById.containsKey(member.getRef()))) { continue; } - OSMWithTags way = waysById.get(member.getRef()); + OsmWithTags way = waysById.get(member.getRef()); if (way == null) { continue; } @@ -1025,7 +1025,7 @@ private void processRoute(OSMRelation relation) { addUniqueName(way.getTag("otp:route_name"), relation.getTag("name")) ); } else { - way.addTag(new OSMTag("otp:route_name", relation.getTag("name"))); + way.addTag(new OsmTag("otp:route_name", relation.getTag("name"))); } } if (relation.hasTag("ref")) { @@ -1035,7 +1035,7 @@ private void processRoute(OSMRelation relation) { addUniqueName(way.getTag("otp:route_ref"), relation.getTag("ref")) ); } else { - way.addTag(new OSMTag("otp:route_ref", relation.getTag("ref"))); + way.addTag(new OsmTag("otp:route_ref", relation.getTag("ref"))); } } } @@ -1053,9 +1053,9 @@ private void processRoute(OSMRelation relation) { * @author hannesj * @see "http://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area" */ - private void processPublicTransportStopArea(OSMRelation relation) { - Set platformAreas = new HashSet<>(); - Set platformNodes = new HashSet<>(); + private void processPublicTransportStopArea(OsmRelation relation) { + Set platformAreas = new HashSet<>(); + Set platformNodes = new HashSet<>(); for (OSMRelationMember member : relation.getMembers()) { switch (member.getType()) { case NODE -> { @@ -1077,7 +1077,7 @@ private void processPublicTransportStopArea(OSMRelation relation) { } } - for (OSMWithTags area : platformAreas) { + for (OsmWithTags area : platformAreas) { if (area == null) { throw new RuntimeException( "Could not process public transport relation '%s' (%s)".formatted( @@ -1114,9 +1114,9 @@ static class RingSegment { Ring ring; - OSMNode nA; + OsmNode nA; - OSMNode nB; + OsmNode nB; } private record KeyPair(long id0, long id1) {} diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java index df46836942f..7e9a93c343c 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java @@ -20,9 +20,9 @@ import org.opentripplanner.graph_builder.module.osm.parameters.OsmProcessingParameters; import org.opentripplanner.openstreetmap.OsmProvider; import org.opentripplanner.openstreetmap.model.OSMLevel; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayProperties; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.util.ElevationUtils; @@ -249,7 +249,7 @@ private void buildBasicGraph() { LOG.info(progress.startMessage()); var escalatorProcessor = new EscalatorProcessor(vertexGenerator.intersectionNodes()); - WAY:for (OSMWay way : osmdb.getWays()) { + WAY:for (OsmWay way : osmdb.getWays()) { WayProperties wayData = way.getOsmProvider().getWayPropertySet().getDataForWay(way); setWayName(way); @@ -267,7 +267,7 @@ private void buildBasicGraph() { String lastLevel = null; for (TLongIterator iter = way.getNodeRefs().iterator(); iter.hasNext();) { long nodeId = iter.next(); - OSMNode node = osmdb.getNode(nodeId); + OsmNode node = osmdb.getNode(nodeId); if (node == null) continue WAY; boolean levelsDiffer = false; String level = node.getTag("level"); @@ -302,10 +302,10 @@ private void buildBasicGraph() { */ Long startNode = null; // where the current edge should start - OSMNode osmStartNode = null; + OsmNode osmStartNode = null; for (int i = 0; i < nodes.size() - 1; i++) { - OSMNode segmentStartOSMNode = osmdb.getNode(nodes.get(i)); + OsmNode segmentStartOSMNode = osmdb.getNode(nodes.get(i)); if (segmentStartOSMNode == null) { continue; @@ -318,7 +318,7 @@ private void buildBasicGraph() { osmStartNode = segmentStartOSMNode; } // where the current edge might end - OSMNode osmEndNode = osmdb.getNode(endNode); + OsmNode osmEndNode = osmdb.getNode(endNode); LineString geometry; @@ -412,7 +412,7 @@ private void validateBarriers() { vertices.forEach(bv -> bv.makeBarrierAtEndReachable()); } - private void setWayName(OSMWithTags way) { + private void setWayName(OsmWithTags way) { if (!way.hasTag("name")) { I18NString creativeName = way.getOsmProvider().getWayPropertySet().getCreativeNameForWay(way); if (creativeName != null) { @@ -422,7 +422,7 @@ private void setWayName(OSMWithTags way) { } private void applyEdgesToTurnRestrictions( - OSMWay way, + OsmWay way, long startNode, long endNode, StreetEdge street, @@ -461,7 +461,7 @@ private void applyEdgesToTurnRestrictions( private StreetEdgePair getEdgesForStreet( IntersectionVertex startEndpoint, IntersectionVertex endEndpoint, - OSMWay way, + OsmWay way, int index, StreetTraversalPermission permissions, LineString geometry @@ -515,7 +515,7 @@ private StreetEdgePair getEdgesForStreet( private StreetEdge getEdgeForStreet( IntersectionVertex startEndpoint, IntersectionVertex endEndpoint, - OSMWay way, + OsmWay way, int index, double length, StreetTraversalPermission permissions, diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java index 940ffa68198..6e20eb093c8 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/ParkingProcessor.java @@ -20,9 +20,9 @@ import org.opentripplanner.graph_builder.issues.InvalidVehicleParkingCapacity; import org.opentripplanner.graph_builder.issues.ParkAndRideUnlinked; import org.opentripplanner.model.calendar.openinghours.OHCalendar; -import org.opentripplanner.openstreetmap.OSMOpeningHoursParser; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.OsmOpeningHoursParser; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingHelper; @@ -43,26 +43,26 @@ class ParkingProcessor { private static final Logger LOG = LoggerFactory.getLogger(ParkingProcessor.class); private static final String VEHICLE_PARKING_OSM_FEED_ID = "OSM"; private final DataImportIssueStore issueStore; - private final OSMOpeningHoursParser osmOpeningHoursParser; - private final BiFunction getVertexForOsmNode; + private final OsmOpeningHoursParser osmOpeningHoursParser; + private final BiFunction getVertexForOsmNode; private final VertexFactory vertexFactory; private final VehicleParkingHelper vehicleParkingHelper; public ParkingProcessor( Graph graph, DataImportIssueStore issueStore, - BiFunction getVertexForOsmNode + BiFunction getVertexForOsmNode ) { this.issueStore = issueStore; this.getVertexForOsmNode = getVertexForOsmNode; this.osmOpeningHoursParser = - new OSMOpeningHoursParser(graph.getOpeningHoursCalendarService(), issueStore); + new OsmOpeningHoursParser(graph.getOpeningHoursCalendarService(), issueStore); this.vertexFactory = new VertexFactory(graph); this.vehicleParkingHelper = new VehicleParkingHelper(graph); } public List buildParkAndRideNodes( - Collection nodes, + Collection nodes, boolean isCarParkAndRide ) { LOG.info("Processing {} P+R nodes.", isCarParkAndRide ? "car" : "bike"); @@ -70,7 +70,7 @@ public List buildParkAndRideNodes( List vehicleParkingToAdd = new ArrayList<>(); - for (OSMNode node : nodes) { + for (OsmNode node : nodes) { n++; I18NString creativeName = nameParkAndRideEntity(node); @@ -130,7 +130,7 @@ private List buildParkAndRideAreasForGroups( return vehicleParkingToAdd; } - private OHCalendar parseOpeningHours(OSMWithTags entity) { + private OHCalendar parseOpeningHours(OsmWithTags entity) { final var openingHoursTag = entity.getTag("opening_hours"); if (openingHoursTag != null) { final ZoneId zoneId = entity.getOsmProvider().getZoneId(); @@ -164,11 +164,11 @@ private List processVehicleParkingArea(Area area, Envelope envelo private List processVehicleParkingArea( Ring ring, - OSMWithTags entity, + OsmWithTags entity, Envelope envelope ) { List accessVertices = new ArrayList<>(); - for (OSMNode node : ring.nodes) { + for (OsmNode node : ring.nodes) { envelope.expandToInclude(new Coordinate(node.lon, node.lat)); var accessVertex = getVertexForOsmNode.apply(node, entity); if (accessVertex.getIncoming().isEmpty() || accessVertex.getOutgoing().isEmpty()) { @@ -192,7 +192,7 @@ private VehicleParking buildParkAndRideAreasForGroup(AreaGroup group, boolean is Envelope envelope = new Envelope(); Set accessVertices = new HashSet<>(); - OSMWithTags entity = null; + OsmWithTags entity = null; // Process all nodes from outer rings // These are IntersectionVertices not OsmVertices because there can be both OsmVertices and TransitStopStreetVertices. @@ -288,7 +288,7 @@ private VehicleParking buildParkAndRideAreasForGroup(AreaGroup group, boolean is private List createArtificialEntrances( AreaGroup group, I18NString vehicleParkingName, - OSMWithTags entity, + OsmWithTags entity, boolean isCarPark ) { LOG.debug( @@ -315,7 +315,7 @@ private List createArtificialEntra private VehicleParking createVehicleParkingObjectFromOsmEntity( boolean isCarParkAndRide, Coordinate coordinate, - OSMWithTags entity, + OsmWithTags entity, I18NString creativeName, List entrances ) { @@ -395,7 +395,7 @@ private VehicleParking createVehicleParkingObjectFromOsmEntity( .build(); } - private I18NString nameParkAndRideEntity(OSMWithTags osmWithTags) { + private I18NString nameParkAndRideEntity(OsmWithTags osmWithTags) { // If there is an explicit name user that. The explicit name is used so that tag-based // translations are used, which are not handled by "CreativeNamer"s. I18NString creativeName = osmWithTags.getAssumedName(); @@ -416,11 +416,11 @@ private I18NString nameParkAndRideEntity(OSMWithTags osmWithTags) { return creativeName; } - private OptionalInt parseCapacity(OSMWithTags element) { + private OptionalInt parseCapacity(OsmWithTags element) { return parseCapacity(element, "capacity"); } - private OptionalInt parseCapacity(OSMWithTags element, String capacityTag) { + private OptionalInt parseCapacity(OsmWithTags element, String capacityTag) { return element.getTagAsInt( capacityTag, v -> issueStore.add(new InvalidVehicleParkingCapacity(element, v)) @@ -430,7 +430,7 @@ private OptionalInt parseCapacity(OSMWithTags element, String capacityTag) { private List createParkingEntrancesFromAccessVertices( Set accessVertices, I18NString vehicleParkingName, - OSMWithTags entity + OsmWithTags entity ) { List entrances = new ArrayList<>(); var sortedAccessVertices = accessVertices diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/Ring.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/Ring.java index 754bdbc36b2..947653183dd 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/Ring.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/Ring.java @@ -17,20 +17,20 @@ import org.locationtech.jts.geom.Polygon; import org.opentripplanner.framework.geometry.CoordinateArrayListSequence; import org.opentripplanner.framework.geometry.GeometryUtils; -import org.opentripplanner.openstreetmap.model.OSMNode; +import org.opentripplanner.openstreetmap.model.OsmNode; class Ring { private final LinearRing shell; private final List holes = new ArrayList<>(); - public List nodes; + public List nodes; // equivalent to the ring representation, but used for JTS operations public Polygon jtsPolygon; - public Ring(List osmNodes) { + public Ring(List osmNodes) { ArrayList vertices = new ArrayList<>(); nodes = osmNodes; - for (OSMNode node : osmNodes) { + for (OsmNode node : osmNodes) { Coordinate point = new Coordinate(node.lon, node.lat); vertices.add(point); } @@ -49,7 +49,7 @@ public Ring(List osmNodes) { jtsPolygon = calculateJtsPolygon(); } - public Ring(TLongList osmNodes, TLongObjectMap _nodes) { + public Ring(TLongList osmNodes, TLongObjectMap _nodes) { // The collection needs to be mutable, so collect into an ArrayList this( LongStream @@ -73,9 +73,9 @@ public void addHole(Ring hole) { */ boolean isNodeConvex(int i) { int n = nodes.size() - 1; - OSMNode cur = nodes.get(i); - OSMNode prev = nodes.get((i + n - 1) % n); - OSMNode next = nodes.get((i + 1) % n); + OsmNode cur = nodes.get(i); + OsmNode prev = nodes.get((i + n - 1) % n); + OsmNode next = nodes.get((i + 1) % n); return ( (cur.lon - prev.lon) * (next.lat - cur.lat) - (cur.lat - prev.lat) * (next.lon - cur.lon) > 0 ); diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/SafetyValueNormalizer.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/SafetyValueNormalizer.java index a9603d59417..32b144e95fe 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/SafetyValueNormalizer.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/SafetyValueNormalizer.java @@ -4,7 +4,7 @@ import java.util.Set; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.Graphwide; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.tagmapping.OsmTagMapper; import org.opentripplanner.openstreetmap.wayproperty.WayProperties; import org.opentripplanner.routing.graph.Graph; @@ -77,7 +77,7 @@ void applyWayProperties( StreetEdge street, StreetEdge backStreet, WayProperties wayData, - OSMWithTags way + OsmWithTags way ) { OsmTagMapper tagMapperForWay = way.getOsmProvider().getOsmTagMapper(); diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/VertexGenerator.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/VertexGenerator.java index 14489777dd4..8ee36572c11 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/VertexGenerator.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/VertexGenerator.java @@ -9,9 +9,9 @@ import org.locationtech.jts.geom.Coordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.openstreetmap.model.OSMLevel; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.street.model.edge.ElevatorEdge; import org.opentripplanner.street.model.vertex.BarrierVertex; @@ -51,7 +51,7 @@ public VertexGenerator(OsmDatabase osmdb, Graph graph, Set boardingAreaR * @return vertex The graph vertex. This is not always an OSM vertex; it can also be a * {@link OsmBoardingLocationVertex} */ - IntersectionVertex getVertexForOsmNode(OSMNode node, OSMWithTags way) { + IntersectionVertex getVertexForOsmNode(OsmNode node, OsmWithTags way) { // If the node should be decomposed to multiple levels, // use the numeric level because it is unique, the human level may not be (although // it will likely lead to some head-scratching if it is not). @@ -121,7 +121,7 @@ Map> multiLevelNodes() { void initIntersectionNodes() { Set possibleIntersectionNodes = new HashSet<>(); - for (OSMWay way : osmdb.getWays()) { + for (OsmWay way : osmdb.getWays()) { TLongList nodes = way.getNodeRefs(); nodes.forEach(node -> { if (possibleIntersectionNodes.contains(node)) { @@ -159,7 +159,7 @@ Map intersectionNodes() { * @param node the node to record for * @author mattwigway */ - private OsmVertex recordLevel(OSMNode node, OSMWithTags way) { + private OsmVertex recordLevel(OsmNode node, OsmWithTags way) { OSMLevel level = osmdb.getLevelForWay(way); Map vertices; long nodeId = node.getId(); @@ -179,7 +179,7 @@ private OsmVertex recordLevel(OSMNode node, OSMWithTags way) { } private void intersectAreaRingNodes(Set possibleIntersectionNodes, Ring outerRing) { - for (OSMNode node : outerRing.nodes) { + for (OsmNode node : outerRing.nodes) { long nodeId = node.getId(); if (possibleIntersectionNodes.contains(nodeId)) { intersectionNodes.put(nodeId, null); diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/WalkableAreaBuilder.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/WalkableAreaBuilder.java index 89b71403232..f567da5aaf8 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/WalkableAreaBuilder.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/WalkableAreaBuilder.java @@ -26,10 +26,10 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.services.osm.EdgeNamer; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMRelation; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmRelation; import org.opentripplanner.openstreetmap.model.OSMRelationMember; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayProperties; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.StreetMode; @@ -78,7 +78,7 @@ class WalkableAreaBuilder { private final OsmDatabase osmdb; - private final Map wayPropertiesCache = new HashMap<>(); + private final Map wayPropertiesCache = new HashMap<>(); private final VertexGenerator vertexBuilder; @@ -179,7 +179,7 @@ public void buildWithoutVisibility(AreaGroup group) { public void buildWithVisibility(AreaGroup group) { // These sets contain the nodes/vertices which can be used to traverse from the rest of the // street network onto the walkable area - Set startingNodes = new HashSet<>(); + Set startingNodes = new HashSet<>(); Set startingVertices = new HashSet<>(); // List of edges belonging to the walkable area @@ -194,8 +194,8 @@ public void buildWithVisibility(AreaGroup group) { .stream() .map(area -> area.parent) .flatMap(osmWithTags -> - osmWithTags instanceof OSMRelation - ? ((OSMRelation) osmWithTags).getMembers().stream().map(OSMRelationMember::getRef) + osmWithTags instanceof OsmRelation + ? ((OsmRelation) osmWithTags).getMembers().stream().map(OSMRelationMember::getRef) : Stream.of(osmWithTags.getId()) ) .collect(Collectors.toSet()); @@ -210,7 +210,7 @@ public void buildWithVisibility(AreaGroup group) { // the points corresponding to concave or hole vertices // or those linked to ways - HashSet visibilityNodes = new HashSet<>(); + HashSet visibilityNodes = new HashSet<>(); HashSet alreadyAddedEdges = new HashSet<>(); HashSet platformLinkingVertices = new HashSet<>(); // we need to accumulate visibility points from all contained areas @@ -219,7 +219,7 @@ public void buildWithVisibility(AreaGroup group) { GeometryFactory geometryFactory = GeometryUtils.getGeometryFactory(); - OSMWithTags areaEntity = group.getSomeOSMObject(); + OsmWithTags areaEntity = group.getSomeOSMObject(); // we also want to fill in the edges of this area anyway, because we can, // and to avoid the numerical problems that they tend to cause @@ -231,8 +231,8 @@ public void buildWithVisibility(AreaGroup group) { // Add stops/entrances from public transit relations into the area // they may provide the only entrance to a platform // which otherwise would be pruned as unconnected island - Collection entrances = osmdb.getStopsInArea(area.parent); - for (OSMNode node : entrances) { + Collection entrances = osmdb.getStopsInArea(area.parent); + for (OsmNode node : entrances) { var vertex = vertexBuilder.getVertexForOsmNode(node, areaEntity); platformLinkingVertices.add(vertex); visibilityNodes.add(node); @@ -253,7 +253,7 @@ public void buildWithVisibility(AreaGroup group) { .toList(); platformLinkingVertices.addAll(endpointsWithin); for (OsmVertex v : endpointsWithin) { - OSMNode node = osmdb.getNode(v.nodeId); + OsmNode node = osmdb.getNode(v.nodeId); visibilityNodes.add(node); startingNodes.add(node); edgeList.addVisibilityVertex(v); @@ -262,7 +262,7 @@ public void buildWithVisibility(AreaGroup group) { } for (int i = 0; i < outerRing.nodes.size(); ++i) { - OSMNode node = outerRing.nodes.get(i); + OsmNode node = outerRing.nodes.get(i); Set newEdges = createEdgesForRingSegment( edgeList, area, @@ -292,7 +292,7 @@ public void buildWithVisibility(AreaGroup group) { } for (Ring innerRing : outerRing.getHoles()) { for (int j = 0; j < innerRing.nodes.size(); ++j) { - OSMNode node = innerRing.nodes.get(j); + OsmNode node = innerRing.nodes.get(j); edges.addAll( createEdgesForRingSegment(edgeList, area, innerRing, j, alreadyAddedEdges) ); @@ -334,7 +334,7 @@ public void buildWithVisibility(AreaGroup group) { float skip_ratio = (float) maxAreaNodes / (float) visibilityNodes.size(); int i = 0; float sum_i = 0; - for (OSMNode nodeI : visibilityNodes) { + for (OsmNode nodeI : visibilityNodes) { sum_i += skip_ratio; if (Math.floor(sum_i) < i + 1) { continue; @@ -346,7 +346,7 @@ public void buildWithVisibility(AreaGroup group) { } int j = 0; float sum_j = 0; - for (OSMNode nodeJ : visibilityNodes) { + for (OsmNode nodeJ : visibilityNodes) { sum_j += skip_ratio; if (Math.floor(sum_j) < j + 1) { continue; @@ -437,7 +437,7 @@ private void pruneAreaEdges( } } - private boolean isStartingNode(OSMNode node, Set osmWayIds) { + private boolean isStartingNode(OsmNode node, Set osmWayIds) { return ( osmdb.isNodeBelongsToWay(node.getId()) || // Do not add if part of same areaGroup @@ -456,8 +456,8 @@ private Set createEdgesForRingSegment( int i, HashSet alreadyAddedEdges ) { - OSMNode node = ring.nodes.get(i); - OSMNode nextNode = ring.nodes.get((i + 1) % ring.nodes.size()); + OsmNode node = ring.nodes.get(i); + OsmNode nextNode = ring.nodes.get((i + 1) % ring.nodes.size()); NodeEdge nodeEdge = new NodeEdge(node, nextNode); if (alreadyAddedEdges.contains(nodeEdge)) { return Set.of(); @@ -497,7 +497,7 @@ private Set createSegments( // do we need to recurse? if (intersects.size() == 1) { Area area = intersects.getFirst(); - OSMWithTags areaEntity = area.parent; + OsmWithTags areaEntity = area.parent; StreetTraversalPermission areaPermissions = areaEntity.overridePermissions( StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE @@ -634,7 +634,7 @@ private void createNamedAreas(AreaEdgeList edgeList, Ring ring, Collection continue; } NamedArea namedArea = new NamedArea(); - OSMWithTags areaEntity = area.parent; + OsmWithTags areaEntity = area.parent; String id = "way (area) " + areaEntity.getId() + " (splitter linking)"; I18NString name = namer.getNameForWay(areaEntity, id); @@ -700,5 +700,5 @@ public boolean shouldSkipEdge(State current, Edge edge) { } } - private record NodeEdge(OSMNode from, OSMNode to) {} + private record NodeEdge(OsmNode from, OsmNode to) {} } diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/DefaultNamer.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/DefaultNamer.java index ff7b7d17666..415cb9a8806 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/DefaultNamer.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/DefaultNamer.java @@ -3,17 +3,17 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.graph_builder.module.osm.StreetEdgePair; import org.opentripplanner.graph_builder.services.osm.EdgeNamer; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; public class DefaultNamer implements EdgeNamer { @Override - public I18NString name(OSMWithTags way) { + public I18NString name(OsmWithTags way) { return way.getAssumedName(); } @Override - public void recordEdges(OSMWithTags way, StreetEdgePair edge) {} + public void recordEdges(OsmWithTags way, StreetEdgePair edge) {} @Override public void postprocess() {} diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/PortlandCustomNamer.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/PortlandCustomNamer.java index c0ca595fbd7..0c3e4f7147d 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/PortlandCustomNamer.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/PortlandCustomNamer.java @@ -5,7 +5,7 @@ import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.graph_builder.module.osm.StreetEdgePair; import org.opentripplanner.graph_builder.services.osm.EdgeNamer; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.street.model.edge.StreetEdge; /** @@ -45,7 +45,7 @@ public class PortlandCustomNamer implements EdgeNamer { private final HashSet nameByDestination = new HashSet<>(); @Override - public I18NString name(OSMWithTags way) { + public I18NString name(OsmWithTags way) { var defaultName = way.getAssumedName(); if (!way.hasTag("name")) { // this is already a generated name, so there's no need to add any @@ -70,7 +70,7 @@ public I18NString name(OSMWithTags way) { } @Override - public void recordEdges(OSMWithTags way, StreetEdgePair edgePair) { + public void recordEdges(OsmWithTags way, StreetEdgePair edgePair) { final boolean isHighwayLink = isHighwayLink(way); final boolean isLowerLink = isLowerLink(way); edgePair @@ -186,12 +186,12 @@ private static String nameAccordingToOrigin(StreetEdge e, int maxDepth) { return null; } - private static boolean isHighwayLink(OSMWithTags way) { + private static boolean isHighwayLink(OsmWithTags way) { String highway = way.getTag("highway"); return "motorway_link".equals(highway) || "trunk_link".equals(highway); } - private static boolean isLowerLink(OSMWithTags way) { + private static boolean isLowerLink(OsmWithTags way) { String highway = way.getTag("highway"); return ( "secondary_link".equals(highway) || diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java index eafccc0da1b..86469dcafc4 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java @@ -31,7 +31,7 @@ import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.module.osm.StreetEdgePair; import org.opentripplanner.graph_builder.services.osm.EdgeNamer; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.street.model.edge.StreetEdge; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,12 +65,12 @@ public class SidewalkNamer implements EdgeNamer { private PreciseBuffer preciseBuffer; @Override - public I18NString name(OSMWithTags way) { + public I18NString name(OsmWithTags way) { return way.getAssumedName(); } @Override - public void recordEdges(OSMWithTags way, StreetEdgePair pair) { + public void recordEdges(OsmWithTags way, StreetEdgePair pair) { // This way is a sidewalk and hasn't been named yet (and is not explicitly unnamed) if (way.isSidewalk() && way.hasNoName() && !way.isExplicitlyUnnamed()) { pair diff --git a/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java b/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java index 819e9e77d02..062824c12e4 100644 --- a/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java +++ b/src/main/java/org/opentripplanner/graph_builder/services/osm/EdgeNamer.java @@ -6,7 +6,7 @@ import org.opentripplanner.graph_builder.module.osm.naming.DefaultNamer; import org.opentripplanner.graph_builder.module.osm.naming.PortlandCustomNamer; import org.opentripplanner.graph_builder.module.osm.naming.SidewalkNamer; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.standalone.config.framework.json.NodeAdapter; import org.opentripplanner.standalone.config.framework.json.OtpVersion; @@ -18,21 +18,21 @@ public interface EdgeNamer { /** * Get the edge name from an OSM way. */ - I18NString name(OSMWithTags way); + I18NString name(OsmWithTags way); /** * Callback function for each way/edge combination so that more complicated names can be built * in the post-processing step. */ - void recordEdges(OSMWithTags way, StreetEdgePair edge); + void recordEdges(OsmWithTags way, StreetEdgePair edge); /** * Called after each edge has been named to build a more complex name out of the relationships - * tracked in {@link EdgeNamer#recordEdges(OSMWithTags, StreetEdgePair)}. + * tracked in {@link EdgeNamer#recordEdges(OsmWithTags, StreetEdgePair)}. */ void postprocess(); - default I18NString getNameForWay(OSMWithTags way, String id) { + default I18NString getNameForWay(OsmWithTags way, String id) { var name = name(way); if (name == null) { diff --git a/src/main/java/org/opentripplanner/openstreetmap/OpenStreetMapParser.java b/src/main/java/org/opentripplanner/openstreetmap/OpenStreetMapParser.java index e46fc94b784..a3619c5b3a3 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/OpenStreetMapParser.java +++ b/src/main/java/org/opentripplanner/openstreetmap/OpenStreetMapParser.java @@ -7,12 +7,12 @@ import org.openstreetmap.osmosis.osmbinary.BinaryParser; import org.openstreetmap.osmosis.osmbinary.Osmformat; import org.opentripplanner.graph_builder.module.osm.OsmDatabase; -import org.opentripplanner.openstreetmap.model.OSMMemberType; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMRelation; +import org.opentripplanner.openstreetmap.model.OsmMemberType; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmRelation; import org.opentripplanner.openstreetmap.model.OSMRelationMember; -import org.opentripplanner.openstreetmap.model.OSMTag; -import org.opentripplanner.openstreetmap.model.OSMWay; +import org.opentripplanner.openstreetmap.model.OsmTag; +import org.opentripplanner.openstreetmap.model.OsmWay; /** * Parser for the OpenStreetMap PBF Format. @@ -63,12 +63,12 @@ protected void parseRelations(List rels) { } for (Osmformat.Relation i : rels) { - OSMRelation tmp = new OSMRelation(); + OsmRelation tmp = new OsmRelation(); tmp.setId(i.getId()); tmp.setOsmProvider(provider); for (int j = 0; j < i.getKeysCount(); j++) { - OSMTag tag = new OSMTag(); + OsmTag tag = new OsmTag(); String key = internalize(getStringById(i.getKeys(j))); String value = internalize(getStringById(i.getVals(j))); tag.setK(key); @@ -87,11 +87,11 @@ protected void parseRelations(List rels) { relMember.setRole(internalize(getStringById(i.getRolesSid(j)))); if (i.getTypes(j) == Osmformat.Relation.MemberType.NODE) { - relMember.setType(OSMMemberType.NODE); + relMember.setType(OsmMemberType.NODE); } else if (i.getTypes(j) == Osmformat.Relation.MemberType.WAY) { - relMember.setType(OSMMemberType.WAY); + relMember.setType(OsmMemberType.WAY); } else if (i.getTypes(j) == Osmformat.Relation.MemberType.RELATION) { - relMember.setType(OSMMemberType.RELATION); + relMember.setType(OsmMemberType.RELATION); } else { assert false; // TODO; Illegal file? } @@ -113,7 +113,7 @@ protected void parseDense(Osmformat.DenseNodes nodes) { } for (int i = 0; i < nodes.getIdCount(); i++) { - OSMNode tmp = new OSMNode(); + OsmNode tmp = new OsmNode(); long lat = nodes.getLat(i) + lastLat; lastLat = lat; @@ -134,7 +134,7 @@ protected void parseDense(Osmformat.DenseNodes nodes) { int keyid = nodes.getKeysVals(j++); int valid = nodes.getKeysVals(j++); - OSMTag tag = new OSMTag(); + OsmTag tag = new OsmTag(); String key = internalize(getStringById(keyid)); String value = internalize(getStringById(valid)); tag.setK(key); @@ -155,7 +155,7 @@ protected void parseNodes(List nodes) { } for (Osmformat.Node i : nodes) { - OSMNode tmp = new OSMNode(); + OsmNode tmp = new OsmNode(); tmp.setId(i.getId()); tmp.setOsmProvider(provider); tmp.lat = parseLat(i.getLat()); @@ -165,7 +165,7 @@ protected void parseNodes(List nodes) { String key = internalize(getStringById(i.getKeys(j))); // if handler.retain_tag(key) // TODO: filter tags String value = internalize(getStringById(i.getVals(j))); - OSMTag tag = new OSMTag(); + OsmTag tag = new OsmTag(); tag.setK(key); tag.setV(value); tmp.addTag(tag); @@ -182,12 +182,12 @@ protected void parseWays(List ways) { } for (Osmformat.Way i : ways) { - OSMWay tmp = new OSMWay(); + OsmWay tmp = new OsmWay(); tmp.setId(i.getId()); tmp.setOsmProvider(provider); for (int j = 0; j < i.getKeysCount(); j++) { - OSMTag tag = new OSMTag(); + OsmTag tag = new OsmTag(); String key = internalize(getStringById(i.getKeys(j))); String value = internalize(getStringById(i.getVals(j))); tag.setK(key); diff --git a/src/main/java/org/opentripplanner/openstreetmap/OSMOpeningHoursParser.java b/src/main/java/org/opentripplanner/openstreetmap/OsmOpeningHoursParser.java similarity index 99% rename from src/main/java/org/opentripplanner/openstreetmap/OSMOpeningHoursParser.java rename to src/main/java/org/opentripplanner/openstreetmap/OsmOpeningHoursParser.java index fcb8162f740..80e9d5af781 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/OSMOpeningHoursParser.java +++ b/src/main/java/org/opentripplanner/openstreetmap/OsmOpeningHoursParser.java @@ -39,9 +39,9 @@ * * Part of the code is copied from https://github.com/leonardehrenfried/opening-hours-evaluator */ -public class OSMOpeningHoursParser { +public class OsmOpeningHoursParser { - private static final Logger LOG = LoggerFactory.getLogger(OSMOpeningHoursParser.class); + private static final Logger LOG = LoggerFactory.getLogger(OsmOpeningHoursParser.class); private final OpeningHoursCalendarService openingHoursCalendarService; @@ -76,14 +76,14 @@ public class OSMOpeningHoursParser { entry(Month.DEC, java.time.Month.DECEMBER) ); - public OSMOpeningHoursParser( + public OsmOpeningHoursParser( OpeningHoursCalendarService openingHoursCalendarService, DataImportIssueStore issueStore ) { this(openingHoursCalendarService, () -> null, issueStore); } - public OSMOpeningHoursParser( + public OsmOpeningHoursParser( OpeningHoursCalendarService openingHoursCalendarService, Supplier zoneIdSupplier, DataImportIssueStore issueStore @@ -94,7 +94,7 @@ public OSMOpeningHoursParser( this.issueStore = issueStore; } - public OSMOpeningHoursParser( + public OsmOpeningHoursParser( OpeningHoursCalendarService openingHoursCalendarService, ZoneId zoneId ) { diff --git a/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownAssumedGroundLevel.java b/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownAssumedGroundLevel.java index bc7adeb07bd..e3e8e0122e3 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownAssumedGroundLevel.java +++ b/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownAssumedGroundLevel.java @@ -1,9 +1,9 @@ package org.opentripplanner.openstreetmap.issues; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; -public record FloorNumberUnknownAssumedGroundLevel(String layer, OSMWithTags entity) +public record FloorNumberUnknownAssumedGroundLevel(String layer, OsmWithTags entity) implements DataImportIssue { private static final String FMT = "%s : could not determine floor number for layer %s, assumed to be ground-level."; diff --git a/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownGuessedFromAltitude.java b/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownGuessedFromAltitude.java index 74e7cff3fda..acba480f4f3 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownGuessedFromAltitude.java +++ b/src/main/java/org/opentripplanner/openstreetmap/issues/FloorNumberUnknownGuessedFromAltitude.java @@ -1,12 +1,12 @@ package org.opentripplanner.openstreetmap.issues; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; public record FloorNumberUnknownGuessedFromAltitude( String layer, Integer floorNumber, - OSMWithTags entity + OsmWithTags entity ) implements DataImportIssue { private static final String FMT = diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMLevel.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMLevel.java index 6f121ed0e13..1228bcca880 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMLevel.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMLevel.java @@ -54,7 +54,7 @@ public static OSMLevel fromString( Source source, boolean incrementNonNegative, DataImportIssueStore issueStore, - OSMWithTags osmObj + OsmWithTags osmObj ) { /* extract any altitude information after the @ character */ Double altitude = null; @@ -134,7 +134,7 @@ public static List fromSpecList( Source source, boolean incrementNonNegative, DataImportIssueStore issueStore, - OSMWithTags osmObj + OsmWithTags osmObj ) { List levelSpecs = new ArrayList<>(); @@ -165,7 +165,7 @@ public static Map mapFromSpecList( Source source, boolean incrementNonNegative, DataImportIssueStore issueStore, - OSMWithTags osmObj + OsmWithTags osmObj ) { Map map = new HashMap<>(); for (OSMLevel level : fromSpecList( diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMRelationMember.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMRelationMember.java index e2ad2ff9691..3804392c161 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMRelationMember.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMRelationMember.java @@ -1,20 +1,20 @@ package org.opentripplanner.openstreetmap.model; -import static org.opentripplanner.openstreetmap.model.OSMMemberType.WAY; +import static org.opentripplanner.openstreetmap.model.OsmMemberType.WAY; public class OSMRelationMember { - private OSMMemberType type; + private OsmMemberType type; private long ref; private String role; - public OSMMemberType getType() { + public OsmMemberType getType() { return type; } - public void setType(OSMMemberType type) { + public void setType(OsmMemberType type) { this.type = type; } diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMMemberType.java b/src/main/java/org/opentripplanner/openstreetmap/model/OsmMemberType.java similarity index 73% rename from src/main/java/org/opentripplanner/openstreetmap/model/OSMMemberType.java rename to src/main/java/org/opentripplanner/openstreetmap/model/OsmMemberType.java index 6cb9974b9d8..3828a890ea9 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMMemberType.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OsmMemberType.java @@ -1,6 +1,6 @@ package org.opentripplanner.openstreetmap.model; -public enum OSMMemberType { +public enum OsmMemberType { NODE, WAY, RELATION, diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMNode.java b/src/main/java/org/opentripplanner/openstreetmap/model/OsmNode.java similarity index 98% rename from src/main/java/org/opentripplanner/openstreetmap/model/OSMNode.java rename to src/main/java/org/opentripplanner/openstreetmap/model/OsmNode.java index d181cde4564..d508d60c094 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMNode.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OsmNode.java @@ -4,7 +4,7 @@ import org.locationtech.jts.geom.Coordinate; import org.opentripplanner.street.model.StreetTraversalPermission; -public class OSMNode extends OSMWithTags { +public class OsmNode extends OsmWithTags { static final Set MOTOR_VEHICLE_BARRIERS = Set.of("bollard", "bar", "chain"); diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMRelation.java b/src/main/java/org/opentripplanner/openstreetmap/model/OsmRelation.java similarity index 96% rename from src/main/java/org/opentripplanner/openstreetmap/model/OSMRelation.java rename to src/main/java/org/opentripplanner/openstreetmap/model/OsmRelation.java index e181cf97713..9f86b955bd6 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMRelation.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OsmRelation.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -public class OSMRelation extends OSMWithTags { +public class OsmRelation extends OsmWithTags { private final List members = new ArrayList<>(); diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMTag.java b/src/main/java/org/opentripplanner/openstreetmap/model/OsmTag.java similarity index 82% rename from src/main/java/org/opentripplanner/openstreetmap/model/OSMTag.java rename to src/main/java/org/opentripplanner/openstreetmap/model/OsmTag.java index 40bfe1e8560..964471d1d43 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMTag.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OsmTag.java @@ -1,13 +1,13 @@ package org.opentripplanner.openstreetmap.model; -public class OSMTag { +public class OsmTag { private String k; private String v; - public OSMTag() {} + public OsmTag() {} - public OSMTag(String k, String v) { + public OsmTag(String k, String v) { this.k = k; this.v = v; } diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java b/src/main/java/org/opentripplanner/openstreetmap/model/OsmWay.java similarity index 99% rename from src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java rename to src/main/java/org/opentripplanner/openstreetmap/model/OsmWay.java index b1e90044bf2..c9eb47cf3ca 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OsmWay.java @@ -6,7 +6,7 @@ import org.opentripplanner.graph_builder.module.osm.StreetTraversalPermissionPair; import org.opentripplanner.street.model.StreetTraversalPermission; -public class OSMWay extends OSMWithTags { +public class OsmWay extends OsmWithTags { private static final Set ESCALATOR_CONVEYING_TAGS = Set.of( "yes", diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java b/src/main/java/org/opentripplanner/openstreetmap/model/OsmWithTags.java similarity index 99% rename from src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java rename to src/main/java/org/opentripplanner/openstreetmap/model/OsmWithTags.java index 6c5af2b26c6..94fcb45149f 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OsmWithTags.java @@ -24,7 +24,7 @@ /** * A base class for OSM entities containing common methods. */ -public class OSMWithTags { +public class OsmWithTags { /** * highway=* values that we don't want to even consider when building the graph. @@ -82,7 +82,7 @@ public void setId(long id) { /** * Adds a tag. */ - public void addTag(OSMTag tag) { + public void addTag(OsmTag tag) { if (tags == null) tags = new HashMap<>(); tags.put(tag.getK().toLowerCase(), tag.getV()); @@ -91,7 +91,7 @@ public void addTag(OSMTag tag) { /** * Adds a tag. */ - public OSMWithTags addTag(String key, String value) { + public OsmWithTags addTag(String key, String value) { if (key == null || value == null) { return this; } @@ -590,7 +590,7 @@ public boolean isNamed() { * Perhaps this entity has a name that isn't in the source data, but it's also possible that * it's explicitly tagged as not having one. * - * @see OSMWithTags#isExplicitlyUnnamed() + * @see OsmWithTags#isExplicitlyUnnamed() */ public boolean hasNoName() { return !isNamed(); @@ -600,7 +600,7 @@ public boolean hasNoName() { * Whether this entity explicitly doesn't have a name. This is different to no name being * set on the entity in OSM. * - * @see OSMWithTags#isNamed() + * @see OsmWithTags#isNamed() * @see https://wiki.openstreetmap.org/wiki/Tag:noname%3Dyes */ public boolean isExplicitlyUnnamed() { diff --git a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/ConstantSpeedMapper.java b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/ConstantSpeedMapper.java index b233b3f549e..db23b6ca791 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/ConstantSpeedMapper.java +++ b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/ConstantSpeedMapper.java @@ -1,15 +1,7 @@ package org.opentripplanner.openstreetmap.tagmapping; -import static org.opentripplanner.openstreetmap.wayproperty.WayPropertiesBuilder.withModes; -import static org.opentripplanner.street.model.StreetTraversalPermission.ALL; -import static org.opentripplanner.street.model.StreetTraversalPermission.CAR; -import static org.opentripplanner.street.model.StreetTraversalPermission.NONE; -import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN; -import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE; - -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; -import org.opentripplanner.street.model.StreetTraversalPermission; /** * OSM way properties for optimizing distance (not traveling time) in routing. @@ -37,7 +29,7 @@ public void populateProperties(WayPropertySet props) { } @Override - public float getCarSpeedForWay(OSMWithTags way, boolean backward) { + public float getCarSpeedForWay(OsmWithTags way, boolean backward) { /* * Set the same 80 km/h speed for all roads, so that car routing finds shortest path */ diff --git a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapper.java b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapper.java index 5ea949e8d5c..763733bc2f1 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapper.java +++ b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapper.java @@ -9,7 +9,7 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE; import org.opentripplanner.framework.functional.FunctionUtils.TriFunction; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -29,7 +29,7 @@ class FinlandMapper implements OsmTagMapper { @Override public void populateProperties(WayPropertySet props) { - TriFunction defaultWalkSafetyForPermission = ( + TriFunction defaultWalkSafetyForPermission = ( permission, speedLimit, way @@ -208,7 +208,7 @@ else if (speedLimit <= 16.65f) { } @Override - public boolean isBicycleNoThroughTrafficExplicitlyDisallowed(OSMWithTags way) { + public boolean isBicycleNoThroughTrafficExplicitlyDisallowed(OsmWithTags way) { String bicycle = way.getTag("bicycle"); return ( isVehicleThroughTrafficExplicitlyDisallowed(way) || @@ -217,7 +217,7 @@ public boolean isBicycleNoThroughTrafficExplicitlyDisallowed(OSMWithTags way) { } @Override - public boolean isWalkNoThroughTrafficExplicitlyDisallowed(OSMWithTags way) { + public boolean isWalkNoThroughTrafficExplicitlyDisallowed(OsmWithTags way) { String foot = way.getTag("foot"); return isGeneralNoThroughTraffic(way) || doesTagValueDisallowThroughTraffic(foot); } diff --git a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapper.java b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapper.java index f893fbb5519..e1bcfc8fc29 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapper.java +++ b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapper.java @@ -1,6 +1,6 @@ package org.opentripplanner.openstreetmap.tagmapping; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * Modified mapper to allow through traffic for combination access=customers and customers=HVV. @@ -14,7 +14,7 @@ public class HamburgMapper extends GermanyMapper { @Override - public boolean isGeneralNoThroughTraffic(OSMWithTags way) { + public boolean isGeneralNoThroughTraffic(OsmWithTags way) { String access = way.getTag("access"); boolean isNoThroughTraffic = doesTagValueDisallowThroughTraffic(access); diff --git a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapper.java b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapper.java index efe7850f08b..f6126549e83 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapper.java +++ b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapper.java @@ -10,7 +10,7 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE; import java.util.function.BiFunction; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; import org.opentripplanner.openstreetmap.wayproperty.specifier.BestMatchSpecifier; import org.opentripplanner.openstreetmap.wayproperty.specifier.Condition; @@ -121,7 +121,7 @@ else if (speedLimit >= 11.1f) { "residential" ); - BiFunction cycleSafetyHighway = (speedLimit, way) -> { + BiFunction cycleSafetyHighway = (speedLimit, way) -> { if (way.isPedestrianExplicitlyDenied()) { return cycleSafetyVeryHighTraffic; } diff --git a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapper.java b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapper.java index 8bcfbfdf65a..6a45496f964 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapper.java +++ b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapper.java @@ -1,6 +1,6 @@ package org.opentripplanner.openstreetmap.tagmapping; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; /** @@ -22,7 +22,7 @@ default boolean doesTagValueDisallowThroughTraffic(String tagValue) { ); } - default float getCarSpeedForWay(OSMWithTags way, boolean backward) { + default float getCarSpeedForWay(OsmWithTags way, boolean backward) { return way.getOsmProvider().getWayPropertySet().getCarSpeedForWay(way, backward); } @@ -30,12 +30,12 @@ default Float getMaxUsedCarSpeed(WayPropertySet wayPropertySet) { return wayPropertySet.maxUsedCarSpeed; } - default boolean isGeneralNoThroughTraffic(OSMWithTags way) { + default boolean isGeneralNoThroughTraffic(OsmWithTags way) { String access = way.getTag("access"); return doesTagValueDisallowThroughTraffic(access); } - default boolean isVehicleThroughTrafficExplicitlyDisallowed(OSMWithTags way) { + default boolean isVehicleThroughTrafficExplicitlyDisallowed(OsmWithTags way) { String vehicle = way.getTag("vehicle"); if (vehicle != null) { return doesTagValueDisallowThroughTraffic(vehicle); @@ -47,7 +47,7 @@ default boolean isVehicleThroughTrafficExplicitlyDisallowed(OSMWithTags way) { /** * Returns true if through traffic for motor vehicles is not allowed. */ - default boolean isMotorVehicleThroughTrafficExplicitlyDisallowed(OSMWithTags way) { + default boolean isMotorVehicleThroughTrafficExplicitlyDisallowed(OsmWithTags way) { String motorVehicle = way.getTag("motor_vehicle"); if (motorVehicle != null) { return doesTagValueDisallowThroughTraffic(motorVehicle); @@ -59,7 +59,7 @@ default boolean isMotorVehicleThroughTrafficExplicitlyDisallowed(OSMWithTags way /** * Returns true if through traffic for bicycle is not allowed. */ - default boolean isBicycleNoThroughTrafficExplicitlyDisallowed(OSMWithTags way) { + default boolean isBicycleNoThroughTrafficExplicitlyDisallowed(OsmWithTags way) { String bicycle = way.getTag("bicycle"); if (bicycle != null) { return doesTagValueDisallowThroughTraffic(bicycle); @@ -71,7 +71,7 @@ default boolean isBicycleNoThroughTrafficExplicitlyDisallowed(OSMWithTags way) { /** * Returns true if through traffic for walk is not allowed. */ - default boolean isWalkNoThroughTrafficExplicitlyDisallowed(OSMWithTags way) { + default boolean isWalkNoThroughTrafficExplicitlyDisallowed(OsmWithTags way) { String foot = way.getTag("foot"); if (foot != null) { return doesTagValueDisallowThroughTraffic(foot); diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/CreativeNamer.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/CreativeNamer.java index 24f39399761..62cc0aa241c 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/CreativeNamer.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/CreativeNamer.java @@ -1,7 +1,7 @@ package org.opentripplanner.openstreetmap.wayproperty; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * A CreativeNamer makes up names for ways that don't have one in the OSM data set. It does this by @@ -22,7 +22,7 @@ public CreativeNamer(String pattern) { this.creativeNamePattern = pattern; } - public I18NString generateCreativeName(OSMWithTags way) { + public I18NString generateCreativeName(OsmWithTags way) { return LocalizedStringMapper.getInstance().map(creativeNamePattern, way); } } diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/LocalizedStringMapper.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/LocalizedStringMapper.java index 9ea4268b6b7..92277578183 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/LocalizedStringMapper.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/LocalizedStringMapper.java @@ -12,7 +12,7 @@ import org.opentripplanner.framework.i18n.LocalizedString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.resources.ResourceBundleSingleton; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; class LocalizedStringMapper { @@ -45,7 +45,7 @@ static LocalizedStringMapper getInstance() { * from properties Files * @param way OSM way from which tag values are read */ - LocalizedString map(String key, OSMWithTags way) { + LocalizedString map(String key, OsmWithTags way) { List lparams = new ArrayList<>(4); //Which tags do we want from way List tagNames = getTagNames(key); diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/NoteProperties.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/NoteProperties.java index dc5affc1e61..535e107321b 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/NoteProperties.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/NoteProperties.java @@ -4,7 +4,7 @@ import java.util.regex.Pattern; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.TranslatedString; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.street.model.note.StreetNote; import org.opentripplanner.street.model.note.StreetNoteAndMatcher; import org.opentripplanner.street.model.note.StreetNoteMatcher; @@ -22,7 +22,7 @@ public NoteProperties(String notePattern, StreetNoteMatcher noteMatcher) { this.noteMatcher = noteMatcher; } - public StreetNoteAndMatcher generateNote(OSMWithTags way) { + public StreetNoteAndMatcher generateNote(OsmWithTags way) { I18NString text; //TODO: this could probably be made without patternMatch for {} since all notes (at least currently) have {note} as notePattern if (patternMatcher.matcher(notePattern).matches()) { diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySet.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySet.java index 9a414a56080..091fca618bc 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySet.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySet.java @@ -15,7 +15,7 @@ import org.opentripplanner.framework.functional.FunctionUtils.TriFunction; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.specifier.BestMatchSpecifier; import org.opentripplanner.openstreetmap.wayproperty.specifier.OsmSpecifier; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -37,7 +37,7 @@ public class WayPropertySet { private static final Logger LOG = LoggerFactory.getLogger(WayPropertySet.class); /** Sets 1.0 as default safety value for all permissions. */ - private final TriFunction DEFAULT_SAFETY_RESOLVER = + private final TriFunction DEFAULT_SAFETY_RESOLVER = ((permission, speedLimit, osmWay) -> 1.0); private final List wayProperties; @@ -64,9 +64,9 @@ public class WayPropertySet { */ public float maxUsedCarSpeed = 0f; /** Resolves walk safety value for each {@link StreetTraversalPermission}. */ - private TriFunction defaultWalkSafetyForPermission; + private TriFunction defaultWalkSafetyForPermission; /** Resolves bicycle safety value for each {@link StreetTraversalPermission}. */ - private TriFunction defaultBicycleSafetyForPermission; + private TriFunction defaultBicycleSafetyForPermission; /** The WayProperties applied to all ways that do not match any WayPropertyPicker. */ private final WayProperties defaultProperties; private final DataImportIssueStore issueStore; @@ -105,7 +105,7 @@ public WayPropertySet(DataImportIssueStore issueStore) { * Applies the WayProperties whose OSMPicker best matches this way. In addition, WayProperties * that are mixins will have their safety values applied if they match at all. */ - public WayProperties getDataForWay(OSMWithTags way) { + public WayProperties getDataForWay(OsmWithTags way) { WayProperties backwardResult = defaultProperties; WayProperties forwardResult = defaultProperties; int bestBackwardScore = 0; @@ -187,7 +187,7 @@ public WayProperties getDataForWay(OSMWithTags way) { return result; } - public I18NString getCreativeNameForWay(OSMWithTags way) { + public I18NString getCreativeNameForWay(OsmWithTags way) { CreativeNamer bestNamer = null; int bestScore = 0; for (CreativeNamerPicker picker : creativeNamers) { @@ -208,7 +208,7 @@ public I18NString getCreativeNameForWay(OSMWithTags way) { /** * Calculate the automobile speed, in meters per second, for this way. */ - public float getCarSpeedForWay(OSMWithTags way, boolean backward) { + public float getCarSpeedForWay(OsmWithTags way, boolean backward) { // first, check for maxspeed tags Float speed = null; Float currentSpeed; @@ -288,7 +288,7 @@ public float getCarSpeedForWay(OSMWithTags way, boolean backward) { } } - public Set getNoteForWay(OSMWithTags way) { + public Set getNoteForWay(OsmWithTags way) { HashSet out = new HashSet<>(); for (NotePicker picker : notes) { OsmSpecifier specifier = picker.specifier; @@ -300,7 +300,7 @@ public Set getNoteForWay(OSMWithTags way) { return out; } - public boolean getSlopeOverride(OSMWithTags way) { + public boolean getSlopeOverride(OsmWithTags way) { boolean result = false; int bestScore = 0; for (SlopeOverridePicker picker : slopeOverrides) { @@ -418,7 +418,7 @@ public void createNotes(String spec, String patternKey, StreetNoteMatcher matche * provide a default for each permission. Safety can vary based on car speed limit on a way. */ public void setDefaultWalkSafetyForPermission( - TriFunction defaultWalkSafetyForPermission + TriFunction defaultWalkSafetyForPermission ) { if (!this.defaultWalkSafetyForPermission.equals(DEFAULT_SAFETY_RESOLVER)) { throw new IllegalStateException("A custom default walk safety resolver was already set"); @@ -431,7 +431,7 @@ public void setDefaultWalkSafetyForPermission( * provide a default for each permission. Safety can vary based on car speed limit on a way. */ public void setDefaultBicycleSafetyForPermission( - TriFunction defaultBicycleSafetyForPermission + TriFunction defaultBicycleSafetyForPermission ) { if (!this.defaultBicycleSafetyForPermission.equals(DEFAULT_SAFETY_RESOLVER)) { throw new IllegalStateException("A custom default cycling safety resolver was already set"); @@ -481,7 +481,7 @@ public List getWayProperties() { return Collections.unmodifiableList(wayProperties); } - private String dumpTags(OSMWithTags way) { + private String dumpTags(OsmWithTags way) { /* generate warning message */ String all_tags = null; Map tags = way.getTags(); diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifier.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifier.java index 293bcf84644..415ce66bbd5 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifier.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifier.java @@ -3,7 +3,7 @@ import java.util.Arrays; import java.util.stream.Collectors; import org.opentripplanner.framework.tostring.ToStringBuilder; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * Specifies a class of OSM tagged entities (e.g. ways) by a list of tags and their values (which @@ -31,7 +31,7 @@ public BestMatchSpecifier(String spec) { } @Override - public Scores matchScores(OSMWithTags way) { + public Scores matchScores(OsmWithTags way) { int backwardScore = 0, forwardScore = 0; int backwardMatches = 0, forwardMatches = 0; @@ -59,7 +59,7 @@ public Scores matchScores(OSMWithTags way) { } @Override - public int matchScore(OSMWithTags way) { + public int matchScore(OsmWithTags way) { int score = 0; int matches = 0; for (var test : conditions) { diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/Condition.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/Condition.java index 4ad180c16c3..795dd4957cb 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/Condition.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/Condition.java @@ -5,7 +5,7 @@ import static org.opentripplanner.openstreetmap.wayproperty.specifier.Condition.MatchResult.WILDCARD; import java.util.Arrays; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; public sealed interface Condition { String key(); @@ -14,17 +14,17 @@ default MatchResult matchType() { return EXACT; } - boolean isExtendedKeyMatch(OSMWithTags way, String exKey); + boolean isExtendedKeyMatch(OsmWithTags way, String exKey); /** * Test to what degree the OSM entity matches with this operation when taking the regular tag keys * into account. */ - default boolean isMatch(OSMWithTags way) { + default boolean isMatch(OsmWithTags way) { return isExtendedKeyMatch(way, this.key()); } - default MatchResult match(OSMWithTags way) { + default MatchResult match(OsmWithTags way) { return isMatch(way) ? matchType() : NONE; } @@ -35,7 +35,7 @@ default MatchResult match(OSMWithTags way) { * For example, it should not match a way with `cycleway:right=lane` when the `cycleway=lane` was * required but `cycleway:left=lane` should match. */ - default boolean isLeftMatch(OSMWithTags way) { + default boolean isLeftMatch(OsmWithTags way) { var leftKey = this.key() + ":left"; if (way.hasTag(leftKey)) { return isExtendedKeyMatch(way, leftKey); @@ -51,7 +51,7 @@ default boolean isLeftMatch(OSMWithTags way) { * For example, it should not match a way with `cycleway:left=lane` when the `cycleway=lane` was * required but `cycleway:right=lane` should match. */ - default boolean isRightMatch(OSMWithTags way) { + default boolean isRightMatch(OsmWithTags way) { var rightKey = this.key() + ":right"; if (way.hasTag(rightKey)) { return isExtendedKeyMatch(way, rightKey); @@ -64,7 +64,7 @@ default boolean isRightMatch(OSMWithTags way) { * Test to what degree the OSM entity matches with this operation when taking the ':both' key * suffixes into account. */ - default boolean isExplicitBothMatch(OSMWithTags way) { + default boolean isExplicitBothMatch(OsmWithTags way) { var bothKey = this.key() + ":both"; if (way.hasTag(bothKey)) { return isExtendedKeyMatch(way, bothKey); @@ -73,7 +73,7 @@ default boolean isExplicitBothMatch(OSMWithTags way) { } } - default boolean isForwardMatch(OSMWithTags way) { + default boolean isForwardMatch(OsmWithTags way) { var forwardKey = this.key() + ":forward"; if (way.hasTag(forwardKey)) { return isExtendedKeyMatch(way, forwardKey); @@ -83,11 +83,11 @@ default boolean isForwardMatch(OSMWithTags way) { } } - default MatchResult matchForward(OSMWithTags way) { + default MatchResult matchForward(OsmWithTags way) { return isForwardMatch(way) ? matchType() : NONE; } - default boolean isBackwardMatch(OSMWithTags way) { + default boolean isBackwardMatch(OsmWithTags way) { var backwardKey = this.key() + ":backward"; if (way.hasTag(backwardKey)) { return isExtendedKeyMatch(way, backwardKey); @@ -97,7 +97,7 @@ default boolean isBackwardMatch(OSMWithTags way) { } } - default MatchResult matchBackward(OSMWithTags way) { + default MatchResult matchBackward(OsmWithTags way) { return isBackwardMatch(way) ? matchType() : NONE; } @@ -112,7 +112,7 @@ enum MatchResult { */ record Equals(String key, String value) implements Condition { @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { return way.hasTag(exKey) && way.isTag(exKey, value); } @@ -131,7 +131,7 @@ public MatchResult matchType() { return WILDCARD; } @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { return way.hasTag(exKey); } @@ -146,7 +146,7 @@ public String toString() { */ record Absent(String key) implements Condition { @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { return !way.hasTag(exKey); } @@ -161,7 +161,7 @@ public String toString() { */ record GreaterThan(String key, int value) implements Condition { @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { var maybeInt = way.getTagAsInt(exKey, ignored -> {}); return maybeInt.isPresent() && maybeInt.getAsInt() > value; } @@ -177,7 +177,7 @@ public String toString() { */ record LessThan(String key, int value) implements Condition { @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { var maybeInt = way.getTagAsInt(exKey, ignored -> {}); return maybeInt.isPresent() && maybeInt.getAsInt() < value; } @@ -199,7 +199,7 @@ record InclusiveRange(String key, int upper, int lower) implements Condition { } @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { var maybeInt = way.getTagAsInt(exKey, ignored -> {}); return maybeInt.isPresent() && maybeInt.getAsInt() >= lower && maybeInt.getAsInt() <= upper; } @@ -215,7 +215,7 @@ public String toString() { */ record OneOf(String key, String... values) implements Condition { @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { return Arrays.stream(values).anyMatch(value -> way.isTag(exKey, value)); } @@ -237,7 +237,7 @@ public OneOfOrAbsent(String key) { } @Override - public boolean isExtendedKeyMatch(OSMWithTags way, String exKey) { + public boolean isExtendedKeyMatch(OsmWithTags way, String exKey) { return ( !way.hasTag(exKey) || Arrays.stream(values).anyMatch(value -> way.isTag(exKey, value)) ); diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifier.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifier.java index 48c3b5edb64..99b18c30a14 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifier.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifier.java @@ -3,7 +3,7 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * This specifier allows you to specify a very precise match. It will only result in a positive when @@ -39,7 +39,7 @@ public ExactMatchSpecifier(Condition... conditions) { } @Override - public Scores matchScores(OSMWithTags way) { + public Scores matchScores(OsmWithTags way) { return new Scores( allForwardTagsMatch(way) ? bestMatchScore : NO_MATCH_SCORE, allBackwardTagsMatch(way) ? bestMatchScore : NO_MATCH_SCORE @@ -47,7 +47,7 @@ public Scores matchScores(OSMWithTags way) { } @Override - public int matchScore(OSMWithTags way) { + public int matchScore(OsmWithTags way) { if (allTagsMatch(way)) { return bestMatchScore; } else { @@ -60,15 +60,15 @@ public String toDocString() { return conditions.stream().map(Object::toString).collect(Collectors.joining("; ")); } - public boolean allTagsMatch(OSMWithTags way) { + public boolean allTagsMatch(OsmWithTags way) { return conditions.stream().allMatch(o -> o.isMatch(way)); } - public boolean allBackwardTagsMatch(OSMWithTags way) { + public boolean allBackwardTagsMatch(OsmWithTags way) { return conditions.stream().allMatch(c -> c.isBackwardMatch(way)); } - public boolean allForwardTagsMatch(OSMWithTags way) { + public boolean allForwardTagsMatch(OsmWithTags way) { return conditions.stream().allMatch(c -> c.isForwardMatch(way)); } diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/LogicalOrSpecifier.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/LogicalOrSpecifier.java index 74db280115b..b6347e65fc1 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/LogicalOrSpecifier.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/LogicalOrSpecifier.java @@ -3,7 +3,7 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * Allows to specify a 'logical or' condition to specify a match. This intended to be used with a @@ -31,12 +31,12 @@ public LogicalOrSpecifier(String... specs) { } @Override - public Scores matchScores(OSMWithTags way) { + public Scores matchScores(OsmWithTags way) { return Scores.of(matchScore(way)); } @Override - public int matchScore(OSMWithTags way) { + public int matchScore(OsmWithTags way) { var oneMatchesExactly = subSpecs.stream().anyMatch(subspec -> subspec.allTagsMatch(way)); if (oneMatchesExactly) { return 1; diff --git a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/OsmSpecifier.java b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/OsmSpecifier.java index 71d629552ff..cc89ee7a97e 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/OsmSpecifier.java +++ b/src/main/java/org/opentripplanner/openstreetmap/wayproperty/specifier/OsmSpecifier.java @@ -1,7 +1,7 @@ package org.opentripplanner.openstreetmap.wayproperty.specifier; import java.util.Arrays; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * An interface for assigning match scores for OSM entities (mostly ways). The higher the score the @@ -33,14 +33,14 @@ static Condition[] parseConditions(String spec, String separator) { * * @param way an OSM tagged object to compare to this specifier */ - Scores matchScores(OSMWithTags way); + Scores matchScores(OsmWithTags way); /** * Calculates a score expressing how well an OSM entity's tags match this specifier. This does - * exactly the same thing as {@link OsmSpecifier#matchScores(OSMWithTags)} but without regard for + * exactly the same thing as {@link OsmSpecifier#matchScores(OsmWithTags)} but without regard for * :left, :right, :forward, :backward and :both. */ - int matchScore(OSMWithTags way); + int matchScore(OsmWithTags way); /** * Convert this specifier to a human-readable identifier that represents this in (generated) diff --git a/src/main/java/org/opentripplanner/street/model/vertex/OsmVertexOnLevel.java b/src/main/java/org/opentripplanner/street/model/vertex/OsmVertexOnLevel.java index 35457c4eb04..2e9e8a6fc7a 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/OsmVertexOnLevel.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/OsmVertexOnLevel.java @@ -1,6 +1,6 @@ package org.opentripplanner.street.model.vertex; -import org.opentripplanner.openstreetmap.model.OSMNode; +import org.opentripplanner.openstreetmap.model.OsmNode; /** * A vertex that represents an OSM node in conjunction with its level tag like both ends of an @@ -12,7 +12,7 @@ public class OsmVertexOnLevel extends OsmVertex { private final String level; - public OsmVertexOnLevel(OSMNode node, String level) { + public OsmVertexOnLevel(OsmNode node, String level) { super(node.getCoordinate().x, node.getCoordinate().y, node.getId()); this.level = level; } diff --git a/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java b/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java index 3e1a57a4581..07c75727a33 100644 --- a/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java +++ b/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java @@ -4,7 +4,7 @@ import javax.annotation.Nullable; import org.locationtech.jts.geom.Coordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.openstreetmap.model.OSMNode; +import org.opentripplanner.openstreetmap.model.OsmNode; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; @@ -96,7 +96,7 @@ public ExitVertex exit(long nid, Coordinate coordinate, String exitName) { public OsmVertex osm( Coordinate coordinate, - OSMNode node, + OsmNode node, boolean highwayTrafficLight, boolean crossingTrafficLight ) { @@ -139,7 +139,7 @@ public TransitEntranceVertex transitEntrance(Entrance entrance) { return addToGraph(new TransitEntranceVertex(entrance)); } - public OsmVertex levelledOsm(OSMNode node, String level) { + public OsmVertex levelledOsm(OsmNode node, String level) { return addToGraph(new OsmVertexOnLevel(node, level)); } diff --git a/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/TestNamer.java b/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/TestNamer.java index 4002da919d8..0125127b3ce 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/TestNamer.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/TestNamer.java @@ -4,17 +4,17 @@ import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.graph_builder.module.osm.StreetEdgePair; import org.opentripplanner.graph_builder.services.osm.EdgeNamer; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; class TestNamer implements EdgeNamer { @Override - public I18NString name(OSMWithTags way) { + public I18NString name(OsmWithTags way) { return new NonLocalizedString(String.valueOf(way.getId())); } @Override - public void recordEdges(OSMWithTags way, StreetEdgePair edge) {} + public void recordEdges(OsmWithTags way, StreetEdgePair edge) {} @Override public void postprocess() {} diff --git a/src/test/java/org/opentripplanner/graph_builder/module/osm/OpenStreetMapParserTest.java b/src/test/java/org/opentripplanner/graph_builder/module/osm/OpenStreetMapParserTest.java index b0073475699..37dbbc567d1 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/osm/OpenStreetMapParserTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/osm/OpenStreetMapParserTest.java @@ -8,8 +8,8 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.openstreetmap.OsmProvider; -import org.opentripplanner.openstreetmap.model.OSMNode; -import org.opentripplanner.openstreetmap.model.OSMWay; +import org.opentripplanner.openstreetmap.model.OsmNode; +import org.opentripplanner.openstreetmap.model.OsmWay; import org.opentripplanner.test.support.ResourceLoader; public class OpenStreetMapParserTest { @@ -24,7 +24,7 @@ public void testBinaryParser() { assertEquals(2297, osmdb.nodeCount()); - OSMNode nodeA = osmdb.getNode(314192918L); + OsmNode nodeA = osmdb.getNode(314192918L); assertEquals(314192918, nodeA.getId()); assertEquals(52.3750447, nodeA.lat, 0.0000001); assertEquals(16.8431974, nodeA.lon, 0.0000001); @@ -33,7 +33,7 @@ public void testBinaryParser() { assertEquals(545, osmdb.wayCount()); - OSMWay wayA = osmdb.getWay(13490353L); + OsmWay wayA = osmdb.getWay(13490353L); assertEquals(13490353, wayA.getId()); TLongList nodeRefsA = wayA.getNodeRefs(); assertEquals(2, nodeRefsA.size()); diff --git a/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java b/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java index 043dba98ba0..443bc36cd14 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/osm/OsmModuleTest.java @@ -20,8 +20,8 @@ import org.opentripplanner.framework.i18n.LocalizedString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.openstreetmap.OsmProvider; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.CreativeNamer; import org.opentripplanner.openstreetmap.wayproperty.MixinPropertiesBuilder; import org.opentripplanner.openstreetmap.wayproperty.WayProperties; @@ -159,7 +159,7 @@ public void testBuildAreaWithVisibility() { @Test public void testWayDataSet() { - OSMWithTags way = new OSMWay(); + OsmWithTags way = new OsmWay(); way.addTag("highway", "footway"); way.addTag("cycleway", "lane"); way.addTag("surface", "gravel"); @@ -213,7 +213,7 @@ public void testWayDataSet() { assertEquals(dataForWay.bicycleSafety().forward(), 1.5); // test a left-right distinction - way = new OSMWay(); + way = new OsmWay(); way.addTag("highway", "footway"); way.addTag("cycleway", "lane"); way.addTag("cycleway:right", "track"); @@ -231,7 +231,7 @@ public void testWayDataSet() { // left comes from lane assertEquals(0.75, dataForWay.bicycleSafety().back()); - way = new OSMWay(); + way = new OsmWay(); way.addTag("highway", "footway"); way.addTag("footway", "sidewalk"); way.addTag("RLIS:reviewed", "no"); @@ -248,7 +248,7 @@ public void testWayDataSet() { @Test public void testCreativeNaming() { - OSMWithTags way = new OSMWay(); + OsmWithTags way = new OsmWay(); way.addTag("highway", "footway"); way.addTag("cycleway", "lane"); way.addTag("access", "no"); diff --git a/src/test/java/org/opentripplanner/graph_builder/module/osm/RingTest.java b/src/test/java/org/opentripplanner/graph_builder/module/osm/RingTest.java index ea47bed8842..f74caf42d5d 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/osm/RingTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/osm/RingTest.java @@ -6,25 +6,25 @@ import java.util.List; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMNode; +import org.opentripplanner.openstreetmap.model.OsmNode; class RingTest { @Test void testIsNodeConvex() { - OSMNode a = new OSMNode(); + OsmNode a = new OsmNode(); a.lat = 0.0; a.lon = 0.0; - OSMNode b = new OSMNode(); + OsmNode b = new OsmNode(); b.lat = 1.0; b.lon = 0.0; - OSMNode c = new OSMNode(); + OsmNode c = new OsmNode(); c.lat = 1.0; c.lon = 1.0; - OSMNode d = new OSMNode(); + OsmNode d = new OsmNode(); d.lat = 0.0; d.lon = 1.0; - OSMNode e = new OSMNode(); + OsmNode e = new OsmNode(); e.lat = 0.5; e.lon = 0.5; diff --git a/src/test/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamerTest.java b/src/test/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamerTest.java index c1c3d7e5e73..de383700644 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamerTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamerTest.java @@ -14,7 +14,7 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.graph_builder.module.osm.StreetEdgePair; import org.opentripplanner.graph_builder.services.osm.EdgeNamer; -import org.opentripplanner.openstreetmap.model.OSMWay; +import org.opentripplanner.openstreetmap.model.OsmWay; import org.opentripplanner.openstreetmap.wayproperty.specifier.WayTestData; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; @@ -111,5 +111,5 @@ private static StreetEdgeBuilder edgeBuilder(WgsCoordinate... c) { } } - private record EdgePair(OSMWay way, StreetEdge edge) {} + private record EdgePair(OsmWay way, StreetEdge edge) {} } diff --git a/src/test/java/org/opentripplanner/openstreetmap/OSMOpeningHoursParserTest.java b/src/test/java/org/opentripplanner/openstreetmap/OsmOpeningHoursParserTest.java similarity index 98% rename from src/test/java/org/opentripplanner/openstreetmap/OSMOpeningHoursParserTest.java rename to src/test/java/org/opentripplanner/openstreetmap/OsmOpeningHoursParserTest.java index 34f141e8504..2af5088c25a 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/OSMOpeningHoursParserTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/OsmOpeningHoursParserTest.java @@ -17,7 +17,7 @@ import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.transit.model.framework.Deduplicator; -public class OSMOpeningHoursParserTest { +public class OsmOpeningHoursParserTest { static OpeningHoursCalendarService openingHoursCalendarService = new OpeningHoursCalendarService( new Deduplicator(), @@ -25,7 +25,7 @@ public class OSMOpeningHoursParserTest { LocalDate.of(2023, Month.DECEMBER, 31) ); - static OSMOpeningHoursParser osmOpeningHoursParser = new OSMOpeningHoursParser( + static OsmOpeningHoursParser osmOpeningHoursParser = new OsmOpeningHoursParser( openingHoursCalendarService, ZoneIds.PARIS ); diff --git a/src/test/java/org/opentripplanner/openstreetmap/model/OSMNodeTest.java b/src/test/java/org/opentripplanner/openstreetmap/model/OSMNodeTest.java index a4579dec71e..d8a9fd85b17 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/model/OSMNodeTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/model/OSMNodeTest.java @@ -9,7 +9,7 @@ public class OSMNodeTest { @Test public void testIsMultiLevel() { - OSMNode node = new OSMNode(); + OsmNode node = new OsmNode(); assertFalse(node.isMultiLevel()); node.addTag("highway", "var"); diff --git a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java index c0af4cf2701..115e7c5472c 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java @@ -10,7 +10,7 @@ public class OSMWayTest { @Test void testIsBicycleDismountForced() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); assertFalse(way.isBicycleDismountForced()); way.addTag("bicycle", "dismount"); @@ -19,7 +19,7 @@ void testIsBicycleDismountForced() { @Test void testIsSteps() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); assertFalse(way.isSteps()); way.addTag("highway", "primary"); @@ -31,12 +31,12 @@ void testIsSteps() { @Test void wheelchairAccessibleStairs() { - var osm1 = new OSMWay(); + var osm1 = new OsmWay(); osm1.addTag("highway", "steps"); assertFalse(osm1.isWheelchairAccessible()); // explicitly suitable for wheelchair users, perhaps because of a ramp - var osm2 = new OSMWay(); + var osm2 = new OsmWay(); osm2.addTag("highway", "steps"); osm2.addTag("wheelchair", "yes"); assertTrue(osm2.isWheelchairAccessible()); @@ -44,7 +44,7 @@ void wheelchairAccessibleStairs() { @Test void testIsRoundabout() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); assertFalse(way.isRoundabout()); way.addTag("junction", "dovetail"); @@ -56,7 +56,7 @@ void testIsRoundabout() { @Test void testIsOneWayDriving() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); assertFalse(way.isOneWayForwardDriving()); assertFalse(way.isOneWayReverseDriving()); @@ -75,7 +75,7 @@ void testIsOneWayDriving() { @Test void testIsOneWayBicycle() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); assertFalse(way.isOneWayForwardBicycle()); assertFalse(way.isOneWayReverseBicycle()); @@ -94,7 +94,7 @@ void testIsOneWayBicycle() { @Test void testIsOpposableCycleway() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); assertFalse(way.isOpposableCycleway()); way.addTag("cycleway", "notatagvalue"); @@ -115,7 +115,7 @@ void testIsOpposableCycleway() { void escalator() { assertFalse(WayTestData.cycleway().isEscalator()); - var escalator = new OSMWay(); + var escalator = new OsmWay(); escalator.addTag("highway", "steps"); assertFalse(escalator.isEscalator()); diff --git a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java b/src/test/java/org/opentripplanner/openstreetmap/model/OsmWithTagsTest.java similarity index 81% rename from src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java rename to src/test/java/org/opentripplanner/openstreetmap/model/OsmWithTagsTest.java index 3b50d0bff0d..e07e991b532 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/model/OsmWithTagsTest.java @@ -12,11 +12,11 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.openstreetmap.wayproperty.specifier.WayTestData; -public class OSMWithTagsTest { +public class OsmWithTagsTest { @Test void testHasTag() { - OSMWithTags o = new OSMWithTags(); + OsmWithTags o = new OsmWithTags(); assertFalse(o.hasTag("foo")); assertFalse(o.hasTag("FOO")); o.addTag("foo", "bar"); @@ -27,7 +27,7 @@ void testHasTag() { @Test void testGetTag() { - OSMWithTags o = new OSMWithTags(); + OsmWithTags o = new OsmWithTags(); assertNull(o.getTag("foo")); assertNull(o.getTag("FOO")); @@ -38,35 +38,35 @@ void testGetTag() { @Test void testIsFalse() { - assertTrue(OSMWithTags.isFalse("no")); - assertTrue(OSMWithTags.isFalse("0")); - assertTrue(OSMWithTags.isFalse("false")); - - assertFalse(OSMWithTags.isFalse("yes")); - assertFalse(OSMWithTags.isFalse("1")); - assertFalse(OSMWithTags.isFalse("true")); - assertFalse(OSMWithTags.isFalse("foo")); - assertFalse(OSMWithTags.isFalse("bar")); - assertFalse(OSMWithTags.isFalse("baz")); + assertTrue(OsmWithTags.isFalse("no")); + assertTrue(OsmWithTags.isFalse("0")); + assertTrue(OsmWithTags.isFalse("false")); + + assertFalse(OsmWithTags.isFalse("yes")); + assertFalse(OsmWithTags.isFalse("1")); + assertFalse(OsmWithTags.isFalse("true")); + assertFalse(OsmWithTags.isFalse("foo")); + assertFalse(OsmWithTags.isFalse("bar")); + assertFalse(OsmWithTags.isFalse("baz")); } @Test void testIsTrue() { - assertTrue(OSMWithTags.isTrue("yes")); - assertTrue(OSMWithTags.isTrue("1")); - assertTrue(OSMWithTags.isTrue("true")); - - assertFalse(OSMWithTags.isTrue("no")); - assertFalse(OSMWithTags.isTrue("0")); - assertFalse(OSMWithTags.isTrue("false")); - assertFalse(OSMWithTags.isTrue("foo")); - assertFalse(OSMWithTags.isTrue("bar")); - assertFalse(OSMWithTags.isTrue("baz")); + assertTrue(OsmWithTags.isTrue("yes")); + assertTrue(OsmWithTags.isTrue("1")); + assertTrue(OsmWithTags.isTrue("true")); + + assertFalse(OsmWithTags.isTrue("no")); + assertFalse(OsmWithTags.isTrue("0")); + assertFalse(OsmWithTags.isTrue("false")); + assertFalse(OsmWithTags.isTrue("foo")); + assertFalse(OsmWithTags.isTrue("bar")); + assertFalse(OsmWithTags.isTrue("baz")); } @Test void testIsTagFalseOrTrue() { - OSMWithTags o = new OSMWithTags(); + OsmWithTags o = new OsmWithTags(); assertFalse(o.isTagFalse("foo")); assertFalse(o.isTagFalse("FOO")); assertFalse(o.isTagTrue("foo")); @@ -88,7 +88,7 @@ void testIsTagFalseOrTrue() { @Test void isTag() { var name = "Brendan"; - var osm = new OSMWithTags(); + var osm = new OsmWithTags(); osm.addTag("NAME", name); assertTrue(osm.isTag("name", name)); @@ -98,7 +98,7 @@ void isTag() { @Test void testDoesAllowTagAccess() { - OSMWithTags o = new OSMWithTags(); + OsmWithTags o = new OsmWithTags(); assertFalse(o.doesTagAllowAccess("foo")); o.addTag("foo", "bar"); @@ -113,7 +113,7 @@ void testDoesAllowTagAccess() { @Test void testIsGeneralAccessDenied() { - OSMWithTags o = new OSMWithTags(); + OsmWithTags o = new OsmWithTags(); assertFalse(o.isGeneralAccessDenied()); o.addTag("access", "something"); @@ -128,7 +128,7 @@ void testIsGeneralAccessDenied() { @Test void testBicycleDenied() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); assertFalse(tags.isBicycleExplicitlyDenied()); for (var allowedValue : List.of("yes", "unknown", "somevalue")) { @@ -144,7 +144,7 @@ void testBicycleDenied() { @Test void getReferenceTags() { - var osm = new OSMWithTags(); + var osm = new OsmWithTags(); osm.addTag("ref", "A"); assertEquals(Set.of("A"), osm.getMultiTagValues(Set.of("ref", "test"))); @@ -153,7 +153,7 @@ void getReferenceTags() { @Test void getEmptyRefList() { - var osm = new OSMWithTags(); + var osm = new OsmWithTags(); osm.addTag("ref", "A"); assertEquals(Set.of(), osm.getMultiTagValues(Set.of())); @@ -161,7 +161,7 @@ void getEmptyRefList() { @Test void ignoreRefCase() { - var osm = new OSMWithTags(); + var osm = new OsmWithTags(); osm.addTag("ref:IFOPT", "A"); assertEquals(Set.of("A"), osm.getMultiTagValues(Set.of("ref:ifopt"))); @@ -169,7 +169,7 @@ void ignoreRefCase() { @Test void readSemicolonSeparated() { - var osm = new OSMWithTags(); + var osm = new OsmWithTags(); osm.addTag("ref:A", "A;A;B"); assertEquals(Set.of("A", "B"), osm.getMultiTagValues(Set.of("ref:A"))); @@ -177,7 +177,7 @@ void readSemicolonSeparated() { @Test void removeBlankRef() { - var osm = new OSMWithTags(); + var osm = new OsmWithTags(); osm.addTag("ref1", " "); osm.addTag("ref2", ""); @@ -187,7 +187,7 @@ void removeBlankRef() { @Test void shouldNotReturnNull() { - var osm = new OSMWithTags(); + var osm = new OsmWithTags(); osm.addTag("ref1", " "); osm.addTag("ref2", ""); @@ -197,14 +197,14 @@ void shouldNotReturnNull() { @Test void isWheelchairAccessible() { - var osm1 = new OSMWithTags(); + var osm1 = new OsmWithTags(); assertTrue(osm1.isWheelchairAccessible()); - var osm2 = new OSMWithTags(); + var osm2 = new OsmWithTags(); osm2.addTag("wheelchair", "no"); assertFalse(osm2.isWheelchairAccessible()); - var osm3 = new OSMWithTags(); + var osm3 = new OsmWithTags(); osm3.addTag("wheelchair", "yes"); assertTrue(osm3.isWheelchairAccessible()); } @@ -221,7 +221,7 @@ void isPlatform() { @Test void testGenerateI18NForPattern() { - OSMWithTags osmTags = new OSMWithTags(); + OsmWithTags osmTags = new OsmWithTags(); osmTags.addTag("note", "Note EN"); osmTags.addTag("description:fr", "Description FR"); osmTags.addTag("wheelchair:description", "Wheelchair description EN"); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/AtlantaMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/AtlantaMapperTest.java index 3480135cff7..a8c253493aa 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/AtlantaMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/AtlantaMapperTest.java @@ -3,7 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -27,7 +27,7 @@ class AtlantaMapperTest { public void peachtreeRoad() { // Peachtree Rd in Atlanta has sidewalks, and bikes are allowed. // https://www.openstreetmap.org/way/144429544 - OSMWithTags peachtreeRd = new OSMWithTags(); + OsmWithTags peachtreeRd = new OsmWithTags(); peachtreeRd.addTag("highway", "trunk"); peachtreeRd.addTag("lanes", "6"); peachtreeRd.addTag("name", "Peachtree Road"); @@ -42,7 +42,7 @@ public void peachtreeRoad() { public void deKalbAvenue() { // "Outer" ramps from DeKalb Ave onto Moreland Ave in Atlanta have sidewalks, and bikes are allowed. // https://www.openstreetmap.org/way/9164434 - OSMWithTags morelandRamp = new OSMWithTags(); + OsmWithTags morelandRamp = new OsmWithTags(); morelandRamp.addTag("highway", "trunk_link"); morelandRamp.addTag("lanes", "1"); morelandRamp.addTag("oneway", "yes"); @@ -57,7 +57,7 @@ public void deKalbAvenue() { public void tenthStreetNE() { // For sanity check, secondary roads (e.g. 10th Street) should remain allowed for all modes. // https://www.openstreetmap.org/way/505912700 - OSMWithTags tenthSt = new OSMWithTags(); + OsmWithTags tenthSt = new OsmWithTags(); tenthSt.addTag("highway", "secondary"); tenthSt.addTag("lanes", "4"); tenthSt.addTag("maxspeed", "30 mph"); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java index 745cb5644dc..0baf6216e92 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.SpeedPicker; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; import org.opentripplanner.openstreetmap.wayproperty.specifier.BestMatchSpecifier; @@ -35,34 +35,34 @@ public void setup() { */ @Test public void testCarSpeeds() { - OSMWithTags way; + OsmWithTags way; - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("maxspeed", "60"); assertTrue(within(kmhAsMs(60), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(60), wps.getCarSpeedForWay(way, true), epsilon)); - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("maxspeed:forward", "80"); way.addTag("maxspeed:backward", "20"); way.addTag("maxspeed", "40"); assertTrue(within(kmhAsMs(80), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(20), wps.getCarSpeedForWay(way, true), epsilon)); - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("maxspeed", "40"); way.addTag("maxspeed:lanes", "60|80|40"); assertTrue(within(kmhAsMs(80), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(80), wps.getCarSpeedForWay(way, true), epsilon)); - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("maxspeed", "20"); way.addTag("maxspeed:motorcar", "80"); assertTrue(within(kmhAsMs(80), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(80), wps.getCarSpeedForWay(way, true), epsilon)); // test with english units - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("maxspeed", "35 mph"); assertTrue(within(kmhAsMs(35 * 1.609f), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(35 * 1.609f), wps.getCarSpeedForWay(way, true), epsilon)); @@ -74,7 +74,7 @@ public void testCarSpeeds() { wps.addSpeedPicker(getSpeedPicker("surface=gravel", kmhAsMs(10))); wps.defaultCarSpeed = kmhAsMs(25); - way = new OSMWithTags(); + way = new OsmWithTags(); // test default speeds assertTrue(within(kmhAsMs(25), wps.getCarSpeedForWay(way, false), epsilon)); @@ -84,18 +84,18 @@ public void testCarSpeeds() { assertTrue(within(kmhAsMs(35), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(35), wps.getCarSpeedForWay(way, true), epsilon)); - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("surface", "gravel"); assertTrue(within(kmhAsMs(10), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(10), wps.getCarSpeedForWay(way, true), epsilon)); - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("highway", "motorway"); assertTrue(within(kmhAsMs(100), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(100), wps.getCarSpeedForWay(way, true), epsilon)); // make sure that 0-speed ways can't exist - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("maxspeed", "0"); assertTrue(within(kmhAsMs(25), wps.getCarSpeedForWay(way, false), epsilon)); assertTrue(within(kmhAsMs(25), wps.getCarSpeedForWay(way, true), epsilon)); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapperTest.java index 4dd52195acb..3ca888a6ffe 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/FinlandMapperTest.java @@ -4,8 +4,8 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.NONE; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayProperties; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; @@ -24,60 +24,60 @@ public class FinlandMapperTest { */ @Test public void testSafety() { - OSMWithTags primaryWay = new OSMWithTags(); + OsmWithTags primaryWay = new OsmWithTags(); primaryWay.addTag("highway", "primary"); primaryWay.addTag("oneway", "no"); - OSMWithTags livingStreetWay = new OSMWithTags(); + OsmWithTags livingStreetWay = new OsmWithTags(); livingStreetWay.addTag("highway", "living_street"); - OSMWithTags footway = new OSMWithTags(); + OsmWithTags footway = new OsmWithTags(); footway.addTag("highway", "footway"); - OSMWithTags sidewalk = new OSMWithTags(); + OsmWithTags sidewalk = new OsmWithTags(); sidewalk.addTag("footway", "sidewalk"); sidewalk.addTag("highway", "footway"); - OSMWithTags segregatedCycleway = new OSMWithTags(); + OsmWithTags segregatedCycleway = new OsmWithTags(); segregatedCycleway.addTag("segregated", "yes"); segregatedCycleway.addTag("highway", "cycleway"); - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("tunnel", "yes"); tunnel.addTag("highway", "footway"); - OSMWithTags bridge = new OSMWithTags(); + OsmWithTags bridge = new OsmWithTags(); bridge.addTag("bridge", "yes"); bridge.addTag("highway", "footway"); - OSMWithTags footwayCrossing = new OSMWithTags(); + OsmWithTags footwayCrossing = new OsmWithTags(); footwayCrossing.addTag("footway", "crossing"); footwayCrossing.addTag("highway", "footway"); - OSMWithTags footwayCrossingWithTrafficLights = new OSMWithTags(); + OsmWithTags footwayCrossingWithTrafficLights = new OsmWithTags(); footwayCrossingWithTrafficLights.addTag("footway", "crossing"); footwayCrossingWithTrafficLights.addTag("highway", "footway"); footwayCrossingWithTrafficLights.addTag("crossing", "traffic_signals"); - OSMWithTags cyclewayCrossing = new OSMWithTags(); + OsmWithTags cyclewayCrossing = new OsmWithTags(); cyclewayCrossing.addTag("cycleway", "crossing"); cyclewayCrossing.addTag("highway", "cycleway"); - OSMWithTags cyclewayFootwayCrossing = new OSMWithTags(); + OsmWithTags cyclewayFootwayCrossing = new OsmWithTags(); cyclewayFootwayCrossing.addTag("footway", "crossing"); cyclewayFootwayCrossing.addTag("highway", "cycleway"); - OSMWithTags cyclewayCrossingWithTrafficLights = new OSMWithTags(); + OsmWithTags cyclewayCrossingWithTrafficLights = new OsmWithTags(); cyclewayCrossingWithTrafficLights.addTag("cycleway", "crossing"); cyclewayCrossingWithTrafficLights.addTag("highway", "cycleway"); cyclewayCrossingWithTrafficLights.addTag("crossing", "traffic_signals"); - OSMWithTags cyclewayFootwayCrossingWithTrafficLights = new OSMWithTags(); + OsmWithTags cyclewayFootwayCrossingWithTrafficLights = new OsmWithTags(); cyclewayFootwayCrossingWithTrafficLights.addTag("footway", "crossing"); cyclewayFootwayCrossingWithTrafficLights.addTag("highway", "cycleway"); cyclewayFootwayCrossingWithTrafficLights.addTag("crossing", "traffic_signals"); - OSMWithTags cyclewaySegregatedCrossing = new OSMWithTags(); + OsmWithTags cyclewaySegregatedCrossing = new OsmWithTags(); cyclewaySegregatedCrossing.addTag("cycleway", "crossing"); cyclewaySegregatedCrossing.addTag("segregated", "yes"); cyclewaySegregatedCrossing.addTag("highway", "cycleway"); - OSMWithTags cyclewaySegregatedFootwayCrossing = new OSMWithTags(); + OsmWithTags cyclewaySegregatedFootwayCrossing = new OsmWithTags(); cyclewaySegregatedFootwayCrossing.addTag("footway", "crossing"); cyclewaySegregatedFootwayCrossing.addTag("segregated", "yes"); cyclewaySegregatedFootwayCrossing.addTag("highway", "cycleway"); - OSMWithTags cyclewaySegregatedCrossingWithTrafficLights = new OSMWithTags(); + OsmWithTags cyclewaySegregatedCrossingWithTrafficLights = new OsmWithTags(); cyclewaySegregatedCrossingWithTrafficLights.addTag("cycleway", "crossing"); cyclewaySegregatedCrossingWithTrafficLights.addTag("segregated", "yes"); cyclewaySegregatedCrossingWithTrafficLights.addTag("highway", "cycleway"); cyclewaySegregatedCrossingWithTrafficLights.addTag("crossing", "traffic_signals"); - OSMWithTags cyclewaySegregatedFootwayCrossingWithTrafficLights = new OSMWithTags(); + OsmWithTags cyclewaySegregatedFootwayCrossingWithTrafficLights = new OsmWithTags(); cyclewaySegregatedFootwayCrossingWithTrafficLights.addTag("footway", "crossing"); cyclewaySegregatedFootwayCrossingWithTrafficLights.addTag("segregated", "yes"); cyclewaySegregatedFootwayCrossingWithTrafficLights.addTag("highway", "cycleway"); @@ -135,7 +135,7 @@ public void testSafety() { @Test public void testSafetyWithMixins() { - OSMWithTags wayWithMixins = new OSMWithTags(); + OsmWithTags wayWithMixins = new OsmWithTags(); // highway=service has no custom bicycle or walk safety wayWithMixins.addTag("highway", "unclassified"); // surface has mixin bicycle safety of 1.3 but no walk safety @@ -145,7 +145,7 @@ public void testSafetyWithMixins() { // 1.6 is the default walk safety for a way with ALL permissions and speed limit > 35 and <= 60 kph assertEquals(1.6, wps.getDataForWay(wayWithMixins).walkSafety().forward(), epsilon); - OSMWithTags wayWithMixinsAndCustomSafety = new OSMWithTags(); + OsmWithTags wayWithMixinsAndCustomSafety = new OsmWithTags(); // highway=service has custom bicycle safety of 1.1 but no custom walk safety wayWithMixinsAndCustomSafety.addTag("highway", "service"); // surface has mixin bicycle safety of 1.3 but no walk safety @@ -163,32 +163,32 @@ public void testSafetyWithMixins() { epsilon ); - OSMWithTags wayWithBicycleSidePath = new OSMWithTags(); + OsmWithTags wayWithBicycleSidePath = new OsmWithTags(); wayWithBicycleSidePath.addTag("bicycle", "use_sidepath"); assertEquals(8, wps.getDataForWay(wayWithBicycleSidePath).walkSafety().forward(), epsilon); - OSMWithTags wayWithFootSidePath = new OSMWithTags(); + OsmWithTags wayWithFootSidePath = new OsmWithTags(); wayWithFootSidePath.addTag("foot", "use_sidepath"); assertEquals(8, wps.getDataForWay(wayWithFootSidePath).walkSafety().forward(), epsilon); } @Test public void testTagMapping() { - OSMWithTags way; + OsmWithTags way; WayProperties wayData; - way = new OSMWay(); + way = new OsmWay(); way.addTag("highway", "unclassified"); way.addTag("seasonal", "winter"); wayData = wps.getDataForWay(way); assertEquals(wayData.getPermission(), NONE); - way = new OSMWay(); + way = new OsmWay(); way.addTag("highway", "trunk"); way.addTag("ice_road", "yes"); wayData = wps.getDataForWay(way); assertEquals(wayData.getPermission(), NONE); - way = new OSMWay(); + way = new OsmWay(); way.addTag("highway", "track"); way.addTag("winter_road", "yes"); wayData = wps.getDataForWay(way); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java index 00b1049bdda..c3e67efb42c 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java @@ -4,7 +4,7 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -26,10 +26,10 @@ class BikeSafety { @Test void testBikeSafety() { - OSMWithTags way; + OsmWithTags way; // way 361961158 - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("bicycle", "yes"); way.addTag("foot", "designated"); way.addTag("footway", "sidewalk"); @@ -42,7 +42,7 @@ void testBikeSafety() { @Test void cyclewayOpposite() { - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("cycleway", "opposite"); way.addTag("highway", "residential"); way.addTag("lit", "yes"); @@ -65,7 +65,7 @@ void cyclewayOpposite() { @Test void bikePath() { // way332589799 (Radschnellweg BW1) - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("bicycle", "designated"); way.addTag("class:bicycle", "2"); way.addTag("class:bicycle:roadcycling", "1"); @@ -85,7 +85,7 @@ void bikePath() { @Test void track() { - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "track"); way.addTag("motor_vehicle", "agricultural"); way.addTag("surface", "asphalt"); @@ -99,7 +99,7 @@ void track() { @Test void testPermissions() { // https://www.openstreetmap.org/way/124263424 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "track"); way.addTag("tracktype", "grade1"); assertEquals( @@ -108,7 +108,7 @@ void testPermissions() { ); // https://www.openstreetmap.org/way/5155805 - way = new OSMWithTags(); + way = new OsmWithTags(); way.addTag("access:lanes:forward", "yes|no"); way.addTag("bicycle:lanes:forward", "|designated"); way.addTag("change:lanes:forward", "not_right|no"); @@ -142,16 +142,16 @@ void lcnAndRcnShouldNotBeAddedUp() { // https://www.openstreetmap.org/way/26443041 is part of both an lcn and rcn but that shouldn't mean that // it is to be more heavily favoured than other ways that are part of just one. - var both = new OSMWithTags(); + var both = new OsmWithTags(); both.addTag("highway", "residential"); both.addTag("rcn", "yes"); both.addTag("lcn", "yes"); - var justLcn = new OSMWithTags(); + var justLcn = new OsmWithTags(); justLcn.addTag("lcn", "yes"); justLcn.addTag("highway", "residential"); - var residential = new OSMWithTags(); + var residential = new OsmWithTags(); residential.addTag("highway", "residential"); assertEquals( @@ -170,25 +170,25 @@ void bicycleRoadAndLcnShouldNotBeAddedUp() { // https://www.openstreetmap.org/way/22201321 was tagged as bicycle_road without lcn // make it so all ways tagged as some kind of cyclestreets are considered as equally safe - var both = new OSMWithTags(); + var both = new OsmWithTags(); both.addTag("highway", "residential"); both.addTag("bicycle_road", "yes"); both.addTag("cyclestreet", "yes"); both.addTag("lcn", "yes"); - var justBicycleRoad = new OSMWithTags(); + var justBicycleRoad = new OsmWithTags(); justBicycleRoad.addTag("bicycle_road", "yes"); justBicycleRoad.addTag("highway", "residential"); - var justCyclestreet = new OSMWithTags(); + var justCyclestreet = new OsmWithTags(); justCyclestreet.addTag("cyclestreet", "yes"); justCyclestreet.addTag("highway", "residential"); - var justLcn = new OSMWithTags(); + var justLcn = new OsmWithTags(); justLcn.addTag("lcn", "yes"); justLcn.addTag("highway", "residential"); - var residential = new OSMWithTags(); + var residential = new OsmWithTags(); residential.addTag("highway", "residential"); assertEquals( @@ -224,13 +224,13 @@ void bicycleRoadAndLcnShouldNotBeAddedUp() { @Test void setCorrectPermissionsForRoundabouts() { // https://www.openstreetmap.org/way/184185551 - var residential = new OSMWithTags(); + var residential = new OsmWithTags(); residential.addTag("highway", "residential"); residential.addTag("junction", "roundabout"); assertEquals(wps.getDataForWay(residential).getPermission(), StreetTraversalPermission.ALL); //https://www.openstreetmap.org/way/31109939 - var primary = new OSMWithTags(); + var primary = new OsmWithTags(); primary.addTag("highway", "primary"); primary.addTag("junction", "roundabout"); assertEquals( @@ -242,7 +242,7 @@ void setCorrectPermissionsForRoundabouts() { @Test void setCorrectBikeSafetyValuesForBothDirections() { // https://www.openstreetmap.org/way/13420871 - var residential = new OSMWithTags(); + var residential = new OsmWithTags(); residential.addTag("highway", "residential"); residential.addTag("lit", "yes"); residential.addTag("maxspeed", "30"); @@ -258,7 +258,7 @@ void setCorrectBikeSafetyValuesForBothDirections() { @Test void setCorrectPermissionsForSteps() { // https://www.openstreetmap.org/way/64359102 - var steps = new OSMWithTags(); + var steps = new OsmWithTags(); steps.addTag("highway", "steps"); assertEquals(wps.getDataForWay(steps).getPermission(), StreetTraversalPermission.PEDESTRIAN); } @@ -266,7 +266,7 @@ void setCorrectPermissionsForSteps() { @Test void testGermanAutobahnSpeed() { // https://www.openstreetmap.org/way/10879847 - var alzentalstr = new OSMWithTags(); + var alzentalstr = new OsmWithTags(); alzentalstr.addTag("highway", "residential"); alzentalstr.addTag("lit", "yes"); alzentalstr.addTag("maxspeed", "30"); @@ -274,7 +274,7 @@ void testGermanAutobahnSpeed() { alzentalstr.addTag("surface", "asphalt"); assertEquals(8.33333969116211, wps.getCarSpeedForWay(alzentalstr, false), epsilon); - var autobahn = new OSMWithTags(); + var autobahn = new OsmWithTags(); autobahn.addTag("highway", "motorway"); autobahn.addTag("maxspeed", "none"); assertEquals(33.33000183105469, wps.getCarSpeedForWay(autobahn, false), epsilon); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapperTest.java index 1af3eefee18..3cdeb382e2c 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HamburgMapperTest.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; /** * @author Maintained by HBT (geofox-team@hbt.de) @@ -23,7 +23,7 @@ void createMapper() { @Test public void shouldAllowThroughTraffic_WhenAccessCustomers_AndCustomersHVV() { - OSMWithTags way = new OSMWithTags(); + OsmWithTags way = new OsmWithTags(); way.addTag("access", "customers"); way.addTag("customers", "HVV"); @@ -38,7 +38,7 @@ public void shouldAllowThroughTraffic_WhenAccessCustomers_AndCustomersHVV() { @ParameterizedTest @ValueSource(strings = { "no", "destination", "private", "customers", "delivery" }) public void shouldDisallowThroughTraffic_WhenNoCustomersHVV(String access) { - OSMWithTags way = new OSMWithTags(); + OsmWithTags way = new OsmWithTags(); way.addTag("access", access); boolean generalNoThroughTraffic = mapper.isGeneralNoThroughTraffic(way); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HoustonMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HoustonMapperTest.java index 163a206e667..f8298bc65bc 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HoustonMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/HoustonMapperTest.java @@ -7,7 +7,7 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; class HoustonMapperTest { @@ -22,7 +22,7 @@ class HoustonMapperTest { @Test public void lamarTunnel() { // https://www.openstreetmap.org/way/127288293 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "footway"); tunnel.addTag("indoor", "yes"); tunnel.addTag("layer", "-1"); @@ -36,7 +36,7 @@ public void lamarTunnel() { @Test public void harrisCountyTunnel() { // https://www.openstreetmap.org/way/127288288 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "footway"); tunnel.addTag("indoor", "yes"); tunnel.addTag("name", "Harris County Tunnel"); @@ -48,7 +48,7 @@ public void harrisCountyTunnel() { @Test public void pedestrianUnderpass() { // https://www.openstreetmap.org/way/783648925 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "footway"); tunnel.addTag("layer", "-1"); tunnel.addTag("tunnel", "yes"); @@ -59,7 +59,7 @@ public void pedestrianUnderpass() { @Test public void cyclingTunnel() { // https://www.openstreetmap.org/way/220484967 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("bicycle", "designated"); tunnel.addTag("foot", "designated"); tunnel.addTag("highway", "cycleway"); @@ -70,7 +70,7 @@ public void cyclingTunnel() { assertEquals(ALL, wps.getDataForWay(tunnel).getPermission()); // https://www.openstreetmap.org/way/101884176 - tunnel = new OSMWithTags(); + tunnel = new OsmWithTags(); tunnel.addTag("highway", "cycleway"); tunnel.addTag("layer", "-1"); tunnel.addTag("name", "Hogg Woods Trail"); @@ -81,7 +81,7 @@ public void cyclingTunnel() { @Test public void carTunnel() { // https://www.openstreetmap.org/way/598694756 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "primary"); tunnel.addTag("hov", "lane"); tunnel.addTag("lanes", "4"); @@ -100,7 +100,7 @@ public void carTunnel() { @Test public void carUnderpass() { // https://www.openstreetmap.org/way/102925214 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "motorway_link"); tunnel.addTag("lanes", "2"); tunnel.addTag("layer", "-1"); @@ -113,7 +113,7 @@ public void carUnderpass() { @Test public void serviceTunnel() { // https://www.openstreetmap.org/way/15334550 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "service"); tunnel.addTag("layer", "-1"); tunnel.addTag("tunnel", "yes"); @@ -124,7 +124,7 @@ public void serviceTunnel() { @Test public void unclassified() { // https://www.openstreetmap.org/way/44896136 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "unclassified"); tunnel.addTag("name", "Ross Sterling Street"); tunnel.addTag("layer", "-1"); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapperTest.java index cce2bf85cb4..1ec9f06daa9 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/NorwayMapperTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.SafetyFeatures; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; import org.opentripplanner.street.model.StreetTraversalPermission; @@ -50,7 +50,7 @@ static List createExpectedBicycleSafetyForMaxspeedCases() { var expectedSafety = expectedBicycleSafetyMatrix[i][j]; if (!Double.isNaN(expectedSafety)) { var maxspeed = expectedMaxspeeds[j]; - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", highway); way.addTag("maxspeed", String.valueOf(maxspeed)); argumentsList.add(Arguments.of(way, expectedSafety)); @@ -66,7 +66,7 @@ static List createBicycleSafetyWithoutExplicitMaxspeed() { for (int i = 0; i < expectedHighways.length; i++) { var highway = expectedHighways[i]; var expectedSafety = expectedBicycleSafety[i]; - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", highway); argumentsList.add(Arguments.of(way, expectedSafety)); } @@ -78,10 +78,10 @@ static List createLinkRoadLikeMainCases() { for (var i = 0; i < 4; i++) { var highway = expectedHighways[i]; for (var maxspeed : expectedMaxspeeds) { - var mainRoad = new OSMWithTags(); + var mainRoad = new OsmWithTags(); mainRoad.addTag("highway", highway); mainRoad.addTag("maxspeed", String.valueOf(maxspeed)); - var linkRoad = new OSMWithTags(); + var linkRoad = new OsmWithTags(); linkRoad.addTag("highway", highway.concat("_link")); linkRoad.addTag("maxspeed", String.valueOf(maxspeed)); argumentsList.add(Arguments.of(mainRoad, linkRoad)); @@ -92,7 +92,7 @@ static List createLinkRoadLikeMainCases() { @ParameterizedTest(name = "{0} should have a score of {1}") @MethodSource("createExpectedBicycleSafetyForMaxspeedCases") - public void testBicycleSafetyForMaxspeed(OSMWithTags way, Double expected) { + public void testBicycleSafetyForMaxspeed(OsmWithTags way, Double expected) { var result = wps.getDataForWay(way).bicycleSafety(); var expectedSafetyFeatures = new SafetyFeatures(expected, expected); assertEquals(expectedSafetyFeatures, result); @@ -100,7 +100,7 @@ public void testBicycleSafetyForMaxspeed(OSMWithTags way, Double expected) { @ParameterizedTest @MethodSource("createBicycleSafetyWithoutExplicitMaxspeed") - public void testBicycleSafetyWithoutMaxspeed(OSMWithTags way, Double expected) { + public void testBicycleSafetyWithoutMaxspeed(OsmWithTags way, Double expected) { var result = wps.getDataForWay(way).bicycleSafety(); var expectedSafetyFeatures = new SafetyFeatures(expected, expected); assertEquals(expectedSafetyFeatures, result); @@ -108,7 +108,7 @@ public void testBicycleSafetyWithoutMaxspeed(OSMWithTags way, Double expected) { @ParameterizedTest @MethodSource("createLinkRoadLikeMainCases") - public void testBicycleSafetyLikeLinkRoad(OSMWithTags mainRoad, OSMWithTags linkRoad) { + public void testBicycleSafetyLikeLinkRoad(OsmWithTags mainRoad, OsmWithTags linkRoad) { var resultMain = wps.getDataForWay(mainRoad).bicycleSafety(); var resultLink = wps.getDataForWay(linkRoad).bicycleSafety(); @@ -117,7 +117,7 @@ public void testBicycleSafetyLikeLinkRoad(OSMWithTags mainRoad, OSMWithTags link @Test public void testTrunkIsWalkable() { - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "trunk"); assertEquals(StreetTraversalPermission.ALL, wps.getDataForWay(way).getPermission()); @@ -126,13 +126,13 @@ public void testTrunkIsWalkable() { @Test public void testMtbScaleNone() { // https://www.openstreetmap.org/way/302610220 - var way1 = new OSMWithTags(); + var way1 = new OsmWithTags(); way1.addTag("highway", "path"); way1.addTag("mtb:scale", "3"); assertEquals(StreetTraversalPermission.NONE, wps.getDataForWay(way1).getPermission()); - var way2 = new OSMWithTags(); + var way2 = new OsmWithTags(); way2.addTag("highway", "track"); way2.addTag("mtb:scale", "3"); @@ -141,13 +141,13 @@ public void testMtbScaleNone() { @Test public void testMtbScalePedestrian() { - var way1 = new OSMWithTags(); + var way1 = new OsmWithTags(); way1.addTag("highway", "path"); way1.addTag("mtb:scale", "1"); assertEquals(StreetTraversalPermission.PEDESTRIAN, wps.getDataForWay(way1).getPermission()); - var way2 = new OSMWithTags(); + var way2 = new OsmWithTags(); way2.addTag("highway", "track"); way2.addTag("mtb:scale", "1"); @@ -156,13 +156,13 @@ public void testMtbScalePedestrian() { @Test public void testMotorroad() { - var way1 = new OSMWithTags(); + var way1 = new OsmWithTags(); way1.addTag("highway", "trunk"); way1.addTag("motorroad", "yes"); assertEquals(StreetTraversalPermission.CAR, wps.getDataForWay(way1).getPermission()); - var way2 = new OSMWithTags(); + var way2 = new OsmWithTags(); way2.addTag("highway", "primary"); way2.addTag("motorroad", "yes"); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapperTest.java index 164faa644c2..22a8150c4e2 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/OsmTagMapperTest.java @@ -8,14 +8,14 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.CAR; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; public class OsmTagMapperTest { @Test public void isMotorThroughTrafficExplicitlyDisallowed() { - OSMWithTags o = new OSMWithTags(); + OsmWithTags o = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); assertFalse(osmTagMapper.isMotorVehicleThroughTrafficExplicitlyDisallowed(o)); @@ -40,11 +40,11 @@ public void isMotorThroughTrafficExplicitlyDisallowed() { public void constantSpeedCarRouting() { OsmTagMapper osmTagMapper = new ConstantSpeedFinlandMapper(20f); - var slowWay = new OSMWithTags(); + var slowWay = new OsmWithTags(); slowWay.addTag("highway", "residential"); assertEquals(20f, osmTagMapper.getCarSpeedForWay(slowWay, true)); - var fastWay = new OSMWithTags(); + var fastWay = new OsmWithTags(); fastWay.addTag("highway", "motorway"); fastWay.addTag("maxspeed", "120 kmph"); assertEquals(20f, osmTagMapper.getCarSpeedForWay(fastWay, true)); @@ -80,12 +80,12 @@ public void mixin() { wps.setMixinProperties("foo=bar", ofBicycleSafety(0.5)); source.populateProperties(wps); - var withoutFoo = new OSMWithTags(); + var withoutFoo = new OsmWithTags(); withoutFoo.addTag("tag", "imaginary"); assertEquals(2, wps.getDataForWay(withoutFoo).bicycleSafety().back()); // the mixin for foo=bar reduces the bike safety factor - var withFoo = new OSMWithTags(); + var withFoo = new OsmWithTags(); withFoo.addTag("tag", "imaginary"); withFoo.addTag("foo", "bar"); assertEquals(1, wps.getDataForWay(withFoo).bicycleSafety().back()); @@ -93,7 +93,7 @@ public void mixin() { @Test public void testAccessNo() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("access", "no"); @@ -105,7 +105,7 @@ public void testAccessNo() { @Test public void testAccessPrivate() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("access", "private"); @@ -117,7 +117,7 @@ public void testAccessPrivate() { @Test public void testFootModifier() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("access", "private"); @@ -130,7 +130,7 @@ public void testFootModifier() { @Test public void testVehicleDenied() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("vehicle", "destination"); @@ -142,7 +142,7 @@ public void testVehicleDenied() { @Test public void testVehicleDeniedMotorVehiclePermissive() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("vehicle", "destination"); @@ -155,7 +155,7 @@ public void testVehicleDeniedMotorVehiclePermissive() { @Test public void testVehicleDeniedBicyclePermissive() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("vehicle", "destination"); @@ -168,7 +168,7 @@ public void testVehicleDeniedBicyclePermissive() { @Test public void testMotorcycleModifier() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("access", "private"); @@ -181,7 +181,7 @@ public void testMotorcycleModifier() { @Test public void testBicycleModifier() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("access", "private"); @@ -194,7 +194,7 @@ public void testBicycleModifier() { @Test public void testBicyclePermissive() { - OSMWithTags tags = new OSMWithTags(); + OsmWithTags tags = new OsmWithTags(); OsmTagMapper osmTagMapper = new DefaultMapper(); tags.addTag("access", "private"); @@ -205,8 +205,8 @@ public void testBicyclePermissive() { assertTrue(osmTagMapper.isWalkNoThroughTrafficExplicitlyDisallowed(tags)); } - public OSMWithTags way(String key, String value) { - var way = new OSMWithTags(); + public OsmWithTags way(String key, String value) { + var way = new OsmWithTags(); way.addTag(key, value); return way; } diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/PortlandMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/PortlandMapperTest.java index 26f45fd8c32..31677817d28 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/PortlandMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/PortlandMapperTest.java @@ -19,7 +19,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet; public class PortlandMapperTest { @@ -53,7 +53,7 @@ static Stream cases() { @ParameterizedTest(name = "way {0} should have walk safety factor {1}") @MethodSource("cases") - void walkSafety(OSMWithTags way, double expected) { + void walkSafety(OsmWithTags way, double expected) { var score = wps.getDataForWay(way); var ws = score.walkSafety(); diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java index c9ec745d914..acdfe501ff6 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/WayPropertySetTest.java @@ -11,8 +11,8 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.opentripplanner.graph_builder.module.osm.StreetTraversalPermissionPair; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.tagmapping.OsmTagMapper; import org.opentripplanner.openstreetmap.wayproperty.specifier.ExactMatchSpecifier; import org.opentripplanner.openstreetmap.wayproperty.specifier.WayTestData; @@ -25,7 +25,7 @@ class ConditionSpecificity { @Test public void carTunnel() { - OSMWithTags tunnel = WayTestData.carTunnel(); + OsmWithTags tunnel = WayTestData.carTunnel(); WayPropertySet wps = wps(); assertEquals(CAR, wps.getDataForWay(tunnel).getPermission()); } @@ -42,7 +42,7 @@ public void carMaxSpeed() { assertEquals(0f, wps.maxUsedCarSpeed, delta); // Speed limit that is within limits should be used as the max used car speed - OSMWithTags streetWithSpeedLimit = new OSMWithTags(); + OsmWithTags streetWithSpeedLimit = new OsmWithTags(); streetWithSpeedLimit.addTag("highway", "motorway"); streetWithSpeedLimit.addTag("maxspeed", "120"); var waySpeed = wps.getCarSpeedForWay(streetWithSpeedLimit, false); @@ -51,7 +51,7 @@ public void carMaxSpeed() { // Speed limit that is higher than maxPossibleCarSpeed should be ignored and regular motorway // speed limit should be used instead - OSMWithTags streetWithTooHighSpeedLimit = new OSMWithTags(); + OsmWithTags streetWithTooHighSpeedLimit = new OsmWithTags(); streetWithTooHighSpeedLimit.addTag("highway", "motorway"); streetWithTooHighSpeedLimit.addTag("maxspeed", "200"); waySpeed = wps.getCarSpeedForWay(streetWithTooHighSpeedLimit, false); @@ -60,7 +60,7 @@ public void carMaxSpeed() { // Speed limit that is too low should be ignored and regular motorway speed limit should // be used instead - OSMWithTags streetWithTooLowSpeedLimit = new OSMWithTags(); + OsmWithTags streetWithTooLowSpeedLimit = new OsmWithTags(); streetWithTooLowSpeedLimit.addTag("highway", "motorway"); streetWithTooLowSpeedLimit.addTag("maxspeed", "0"); waySpeed = wps.getCarSpeedForWay(streetWithTooLowSpeedLimit, false); @@ -111,7 +111,7 @@ class NoMapper { */ @Test void testCarPermission() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); way.addTag("highway", "unclassified"); var permissionPair = getWayProperties(way); @@ -128,7 +128,7 @@ void testCarPermission() { */ @Test void testMotorCarTagAllowedPermissions() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); way.addTag("highway", "residential"); var permissionPair = getWayProperties(way); assertTrue(permissionPair.main().allows(StreetTraversalPermission.ALL)); @@ -162,7 +162,7 @@ void testMotorCarTagAllowedPermissions() { */ @Test void testMotorCarTagDeniedPermissions() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); way.addTag("highway", "residential"); var permissionPair = getWayProperties(way); assertTrue(permissionPair.main().allows(StreetTraversalPermission.ALL)); @@ -194,7 +194,7 @@ void testMotorCarTagDeniedPermissions() { */ @Test void testMotorVehicleTagAllowedPermissions() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); way.addTag("highway", "residential"); var permissionPair = getWayProperties(way); assertTrue(permissionPair.main().allows(StreetTraversalPermission.ALL)); @@ -230,7 +230,7 @@ void testMotorVehicleTagAllowedPermissions() { */ @Test void testMotorVehicleTagDeniedPermissions() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); way.addTag("highway", "residential"); var permissionPair = getWayProperties(way); assertTrue(permissionPair.main().allows(StreetTraversalPermission.ALL)); @@ -254,7 +254,7 @@ void testMotorVehicleTagDeniedPermissions() { assertTrue(permissionPair.main().allowsNothing());*/ } - private StreetTraversalPermissionPair getWayProperties(OSMWay way) { + private StreetTraversalPermissionPair getWayProperties(OsmWay way) { WayPropertySet wayPropertySet = new WayPropertySet(); WayProperties wayData = wayPropertySet.getDataForWay(way); diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifierTest.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifierTest.java index 517e4b57bfd..1eb22620c51 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifierTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/BestMatchSpecifierTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; class BestMatchSpecifierTest extends SpecifierTest { @@ -61,7 +61,7 @@ static Stream leftRightTestCases() { name = "way {0} with specifier {1} should have a backward score {2} and forward score {3}" ) @MethodSource("leftRightTestCases") - void leftRight(OSMWithTags way, OsmSpecifier spec, int expectedBackward, int expectedForward) { + void leftRight(OsmWithTags way, OsmSpecifier spec, int expectedBackward, int expectedForward) { var result = spec.matchScores(way); assertEquals(expectedBackward, result.backward()); assertEquals(expectedForward, result.forward()); diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ConditionTest.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ConditionTest.java index 6386aa902e2..f0ba8242c33 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ConditionTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ConditionTest.java @@ -26,7 +26,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; import org.opentripplanner.openstreetmap.wayproperty.specifier.Condition.Absent; import org.opentripplanner.openstreetmap.wayproperty.specifier.Condition.Equals; import org.opentripplanner.openstreetmap.wayproperty.specifier.Condition.GreaterThan; @@ -71,7 +71,7 @@ static Stream equalsCases() { ) @MethodSource("equalsCases") void leftRight( - OSMWithTags way, + OsmWithTags way, Condition op, MatchResult backwardExpectation, MatchResult forwardExpectation @@ -108,7 +108,7 @@ static Stream otherCases() { @ParameterizedTest(name = "way {0} with op {1} should have a result {2}") @MethodSource("otherCases") - void otherTests(OSMWithTags way, Condition op, MatchResult expectation) { + void otherTests(OsmWithTags way, Condition op, MatchResult expectation) { assertEquals(expectation, op.match(way)); } diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifierTest.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifierTest.java index 85898abd8f2..4bf3d6196ca 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifierTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/ExactMatchSpecifierTest.java @@ -1,7 +1,7 @@ package org.opentripplanner.openstreetmap.wayproperty.specifier; import org.junit.jupiter.api.Test; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; class ExactMatchSpecifierTest extends SpecifierTest { @@ -23,7 +23,7 @@ public void carTunnel() { @Test public void pedestrianTunnelSpecificity() { - OSMWithTags tunnel = WayTestData.pedestrianTunnel(); + OsmWithTags tunnel = WayTestData.pedestrianTunnel(); assertScore(0, highwayPrimarySpec, tunnel); assertScore(600, pedestrianUndergroundTunnelSpec, tunnel); assertScore(800, pedestrianUndergroundIndoorTunnelSpec, tunnel); diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/SpecifierTest.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/SpecifierTest.java index 2a754a1a883..0ac96c46d1a 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/SpecifierTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/SpecifierTest.java @@ -2,11 +2,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWithTags; public class SpecifierTest { - protected void assertScore(int expectedScore, OsmSpecifier spec, OSMWithTags tunnel) { + protected void assertScore(int expectedScore, OsmSpecifier spec, OsmWithTags tunnel) { var result = spec.matchScores(tunnel); assertEquals(expectedScore, result.backward()); assertEquals(expectedScore, result.forward()); diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java index b09f690f794..27d733be254 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java @@ -1,13 +1,13 @@ package org.opentripplanner.openstreetmap.wayproperty.specifier; -import org.opentripplanner.openstreetmap.model.OSMWay; -import org.opentripplanner.openstreetmap.model.OSMWithTags; +import org.opentripplanner.openstreetmap.model.OsmWay; +import org.opentripplanner.openstreetmap.model.OsmWithTags; public class WayTestData { - public static OSMWithTags carTunnel() { + public static OsmWithTags carTunnel() { // https://www.openstreetmap.org/way/598694756 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "primary"); tunnel.addTag("hov", "lane"); tunnel.addTag("lanes", "4"); @@ -22,9 +22,9 @@ public static OSMWithTags carTunnel() { return tunnel; } - public static OSMWithTags pedestrianTunnel() { + public static OsmWithTags pedestrianTunnel() { // https://www.openstreetmap.org/way/127288293 - OSMWithTags tunnel = new OSMWithTags(); + OsmWithTags tunnel = new OsmWithTags(); tunnel.addTag("highway", "footway"); tunnel.addTag("indoor", "yes"); tunnel.addTag("layer", "-1"); @@ -34,10 +34,10 @@ public static OSMWithTags pedestrianTunnel() { return tunnel; } - public static OSMWithTags streetOnBikeRoute() { + public static OsmWithTags streetOnBikeRoute() { // https://www.openstreetmap.org/way/26443041 is part of both an lcn relation - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("lit", "yes"); way.addTag("maxspeed", "30"); @@ -50,9 +50,9 @@ public static OSMWithTags streetOnBikeRoute() { return way; } - public static OSMWithTags stairs() { + public static OsmWithTags stairs() { // https://www.openstreetmap.org/way/1058669389 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("handrail", "yes"); way.addTag("highway", "steps"); way.addTag("incline", "down"); @@ -65,9 +65,9 @@ public static OSMWithTags stairs() { return way; } - public static OSMWithTags southeastLaBonitaWay() { + public static OsmWithTags southeastLaBonitaWay() { // https://www.openstreetmap.org/way/5302874 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("name", "Southeast la Bonita Way"); way.addTag("sidewalk", "both"); @@ -75,9 +75,9 @@ public static OSMWithTags southeastLaBonitaWay() { return way; } - public static OSMWithTags southwestMayoStreet() { + public static OsmWithTags southwestMayoStreet() { //https://www.openstreetmap.org/way/425004690 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("name", "Southwest Mayo Street"); way.addTag("maxspeed", "25 mph"); @@ -86,124 +86,124 @@ public static OSMWithTags southwestMayoStreet() { return way; } - public static OSMWithTags fiveLanes() { - OSMWithTags way = new OSMWithTags(); + public static OsmWithTags fiveLanes() { + OsmWithTags way = new OsmWithTags(); way.addTag("highway", "primary"); way.addTag("lanes", "5"); return way; } - public static OSMWithTags threeLanes() { - OSMWithTags way = new OSMWithTags(); + public static OsmWithTags threeLanes() { + OsmWithTags way = new OsmWithTags(); way.addTag("highway", "primary"); way.addTag("lanes", "3"); return way; } - public static OSMWay cycleway() { - var way = new OSMWay(); + public static OsmWay cycleway() { + var way = new OsmWay(); way.addTag("highway", "residential"); way.addTag("cycleway", "lane"); return way; } - public static OSMWithTags cyclewayLeft() { - var way = new OSMWithTags(); + public static OsmWithTags cyclewayLeft() { + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("cycleway:left", "lane"); return way; } - public static OSMWithTags cyclewayBoth() { - var way = new OSMWithTags(); + public static OsmWithTags cyclewayBoth() { + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("cycleway:both", "lane"); return way; } - public static OSMWay footwaySidewalk() { - var way = new OSMWay(); + public static OsmWay footwaySidewalk() { + var way = new OsmWay(); way.addTag("footway", "sidewalk"); way.addTag("highway", "footway"); return way; } - public static OSMWithTags sidewalkBoth() { - var way = new OSMWithTags(); + public static OsmWithTags sidewalkBoth() { + var way = new OsmWithTags(); way.addTag("highway", "both"); way.addTag("sidewalk", "both"); return way; } - public static OSMWithTags noSidewalk() { - var way = new OSMWithTags(); + public static OsmWithTags noSidewalk() { + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("sidewalk", "no"); return way; } - public static OSMWithTags noSidewalkHighSpeed() { - var way = new OSMWithTags(); + public static OsmWithTags noSidewalkHighSpeed() { + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("sidewalk", "no"); way.addTag("maxspeed", "55 mph"); return way; } - public static OSMWithTags highwayTrunk() { - var way = new OSMWithTags(); + public static OsmWithTags highwayTrunk() { + var way = new OsmWithTags(); way.addTag("highway", "trunk"); return way; } - public static OSMWay highwayTertiary() { - var way = new OSMWay(); + public static OsmWay highwayTertiary() { + var way = new OsmWay(); way.addTag("highway", "tertiary"); return way; } - public static OSMWithTags highwayTertiaryWithSidewalk() { - var way = new OSMWithTags(); + public static OsmWithTags highwayTertiaryWithSidewalk() { + var way = new OsmWithTags(); way.addTag("highway", "tertiary"); way.addTag("sidewalk", "both"); return way; } - public static OSMWithTags cobblestones() { - var way = new OSMWithTags(); + public static OsmWithTags cobblestones() { + var way = new OsmWithTags(); way.addTag("highway", "residential"); way.addTag("surface", "cobblestones"); return way; } - public static OSMWithTags cyclewayLaneTrack() { - var way = new OSMWithTags(); + public static OsmWithTags cyclewayLaneTrack() { + var way = new OsmWithTags(); way.addTag("highway", "footway"); way.addTag("cycleway", "lane"); way.addTag("cycleway:right", "track"); return way; } - public static OSMWithTags tramsForward() { + public static OsmWithTags tramsForward() { // https://www.openstreetmap.org/way/108037345 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "tertiary"); way.addTag("embedded_rails:forward", "tram"); return way; } - public static OSMWithTags veryBadSmoothness() { + public static OsmWithTags veryBadSmoothness() { // https://www.openstreetmap.org/way/11402648 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "footway"); way.addTag("surface", "sett"); way.addTag("smoothness", "very_bad"); return way; } - public static OSMWithTags excellentSmoothness() { + public static OsmWithTags excellentSmoothness() { // https://www.openstreetmap.org/way/437167371 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("highway", "cycleway"); way.addTag("segregated", "no"); way.addTag("surface", "asphalt"); @@ -211,9 +211,9 @@ public static OSMWithTags excellentSmoothness() { return way; } - public static OSMWithTags zooPlatform() { + public static OsmWithTags zooPlatform() { // https://www.openstreetmap.org/way/119108622 - var way = new OSMWithTags(); + var way = new OsmWithTags(); way.addTag("public_transport", "platform"); way.addTag("usage", "tourism"); return way; diff --git a/src/test/java/org/opentripplanner/street/model/vertex/BarrierVertexTest.java b/src/test/java/org/opentripplanner/street/model/vertex/BarrierVertexTest.java index a92d69b39f0..bf500e2865e 100644 --- a/src/test/java/org/opentripplanner/street/model/vertex/BarrierVertexTest.java +++ b/src/test/java/org/opentripplanner/street/model/vertex/BarrierVertexTest.java @@ -8,7 +8,7 @@ import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; -import org.opentripplanner.openstreetmap.model.OSMNode; +import org.opentripplanner.openstreetmap.model.OsmNode; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model._data.StreetModelForTest; @@ -24,7 +24,7 @@ public class BarrierVertexTest { @Test public void testBarrierPermissions() { - OSMNode simpleBarrier = new OSMNode(); + OsmNode simpleBarrier = new OsmNode(); assertFalse(simpleBarrier.isMotorVehicleBarrier()); simpleBarrier.addTag("barrier", "bollard"); assertTrue(simpleBarrier.isMotorVehicleBarrier()); @@ -63,7 +63,7 @@ public void testBarrierPermissions() { ); assertEquals(StreetTraversalPermission.PEDESTRIAN, bv.getBarrierPermissions()); - OSMNode complexBarrier = new OSMNode(); + OsmNode complexBarrier = new OsmNode(); complexBarrier.addTag("barrier", "bollard"); complexBarrier.addTag("access", "no"); @@ -72,7 +72,7 @@ public void testBarrierPermissions() { ); assertEquals(StreetTraversalPermission.NONE, bv.getBarrierPermissions()); - OSMNode noBikeBollard = new OSMNode(); + OsmNode noBikeBollard = new OsmNode(); noBikeBollard.addTag("barrier", "bollard"); noBikeBollard.addTag("bicycle", "no"); @@ -82,7 +82,7 @@ public void testBarrierPermissions() { assertEquals(StreetTraversalPermission.PEDESTRIAN, bv.getBarrierPermissions()); /* test that traversal limitations work also without barrier tag */ - OSMNode accessBarrier = new OSMNode(); + OsmNode accessBarrier = new OsmNode(); accessBarrier.addTag("access", "no"); bv.setBarrierPermissions(