org.opentripplanner.graph_builder.issues.GraphConnectivity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.graph_builder.issues;
import org.opentripplanner.graph_builder.DataImportIssue;
import org.opentripplanner.routing.graph.Vertex;
public class GraphConnectivity implements DataImportIssue {
public static final String FMT = "Removed/depedestrianized disconnected subgraph containing vertex '%s' at (%f, %f), with %d edges";
public static final String HTMLFMT = "Removed/depedestrianized disconnected subgraph containing vertex '%s', with %d edges";
final Vertex vertex;
final int size;
public GraphConnectivity(Vertex vertex, int size){
this.vertex = vertex;
this.size = size;
}
@Override
public String getMessage() {
return String.format(FMT, vertex, vertex.getCoordinate().x, vertex.getCoordinate().y, size);
}
@Override
public String getHTMLMessage() {
String label = vertex.getLabel();
if (label.startsWith("osm:")) {
String osmNodeId = label.split(":")[2];
return String.format(HTMLFMT, osmNodeId, osmNodeId, size);
} else {
return this.getMessage();
}
}
@Override
public Vertex getReferencedVertex() {
return vertex;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy