
org.opentripplanner.graph_builder.module.osm.UnconnectedArea 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
The newest version!
package org.opentripplanner.graph_builder.module.osm;
import java.util.stream.Collectors;
import org.locationtech.jts.geom.Geometry;
import org.opentripplanner.graph_builder.issue.api.DataImportIssue;
public record UnconnectedArea(AreaGroup areaGroup) implements DataImportIssue {
private static final String FMT = "Area %s has no connection to street network";
private static final String HTMLFMT =
"Area '%s' has no connection to street network";
@Override
public String getMessage() {
return String.format(FMT, idList());
}
@Override
public String getHTMLMessage() {
return String.format(HTMLFMT, areaGroup.getSomeOSMObject().url(), idList());
}
@Override
public Geometry getGeometry() {
return areaGroup.union;
}
private String idList() {
return areaGroup.areas
.stream()
.map(area -> area.parent.getId())
.map(Object::toString)
.collect(Collectors.joining(", "));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy