Skip to content

Commit

Permalink
Revert changes to AreaStopsToVerticesMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Feb 3, 2025
1 parent e05c0c7 commit fd9e9ef
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMultimap;
import jakarta.inject.Inject;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.locationtech.jts.geom.Point;
import org.opentripplanner.framework.geometry.GeometryUtils;
import org.opentripplanner.graph_builder.model.GraphBuilderModule;
import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.routing.graph.index.StreetIndex;
import org.opentripplanner.street.model.vertex.StreetVertex;
import org.opentripplanner.street.model.vertex.Vertex;
import org.opentripplanner.transit.model.site.AreaStop;
import org.opentripplanner.transit.service.TimetableRepository;
import org.opentripplanner.utils.logging.ProgressTracker;
Expand Down Expand Up @@ -57,18 +52,12 @@ public void buildGraph() {
var results = timetableRepository
.getSiteRepository()
.listAreaStops()
.stream()
.sorted(Comparator.comparingDouble(areaStop -> areaStop.getGeometry().getArea()))
.parallel()
.parallelStream()
.flatMap(areaStop -> {
LOG.info(
"Computing vertices for {} with area {}",
areaStop,
areaStop.getGeometry().getArea()
);
var result = matchingVerticesForStop(streetIndex, areaStop);
var matchedVertices = matchingVerticesForStop(streetIndex, areaStop);
// Keep lambda! A method-ref would cause incorrect class and line number to be logged
progress.step(m -> LOG.info(m));
return result;
return matchedVertices;
});

ImmutableMultimap<StreetVertex, AreaStop> mappedResults = results.collect(
Expand Down

0 comments on commit fd9e9ef

Please sign in to comment.