|
1 | 1 | package com.conveyal.r5.transit; |
2 | 2 |
|
| 3 | +import com.conveyal.analysis.models.Bounds; |
3 | 4 | import com.conveyal.gtfs.GTFSFeed; |
4 | 5 | import com.conveyal.osmlib.OSM; |
5 | 6 | import com.conveyal.r5.analyst.LinkageCache; |
6 | 7 | import com.conveyal.r5.analyst.WebMercatorGridPointSet; |
7 | 8 | import com.conveyal.r5.analyst.cluster.TransportNetworkConfig; |
8 | 9 | import com.conveyal.r5.analyst.error.TaskError; |
9 | 10 | import com.conveyal.r5.analyst.fare.InRoutingFareCalculator; |
| 11 | +import com.conveyal.r5.analyst.scenario.Modification; |
| 12 | +import com.conveyal.r5.analyst.scenario.ModifyStreets; |
10 | 13 | import com.conveyal.r5.analyst.scenario.Scenario; |
11 | 14 | import com.conveyal.r5.common.JsonUtilities; |
12 | 15 | import com.conveyal.r5.kryo.KryoNetworkSerializer; |
|
32 | 35 | import java.util.zip.ZipEntry; |
33 | 36 | import java.util.zip.ZipFile; |
34 | 37 |
|
| 38 | +import static com.conveyal.r5.streets.VertexStore.FIXED_FACTOR; |
| 39 | + |
35 | 40 | /** |
36 | 41 | * This is a completely new replacement for Graph, Router etc. |
37 | 42 | * It uses a lot less object pointers and can be built, read, and written orders of magnitude faster. |
@@ -376,6 +381,16 @@ public TransportNetwork scenarioCopy(Scenario scenario) { |
376 | 381 | return copy; |
377 | 382 | } |
378 | 383 |
|
| 384 | + public void addScenarioBuffers(Map<String, Integer> buffersByMode) { |
| 385 | + List<String> bufferInfo = new ArrayList<>(); |
| 386 | + bufferInfo.add("Buffers for all modifications tied to street layer:"); |
| 387 | + buffersByMode.forEach((mode, distance) -> { |
| 388 | + Envelope customExtents = streetLayer.scenarioEdgesBoundingGeometry(distance).getEnvelopeInternal(); |
| 389 | + bufferInfo.add(mode +"\n " + Bounds.fromWgsEnvelope(customExtents).toJsonString(FIXED_FACTOR)); |
| 390 | + }); |
| 391 | + this.scenarioApplicationInfo.add(new TaskError(new ModifyStreets(), bufferInfo)); |
| 392 | + } |
| 393 | + |
379 | 394 | /** |
380 | 395 | * FIXME why is this a long when crc32 returns an int? |
381 | 396 | * @return a checksum of the graph, for use in verifying whether it changed or remained the same after |
|
0 commit comments