Skip to content

Commit

Permalink
update network
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Mar 26, 2024
1 parent 97d5e3d commit 1b621d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,23 @@ input/sumo.net.xml: input/network.osm
--tls.guess-signals true --tls.discard-simple --tls.join --tls.default-type actuated\
--junctions.join --junctions.corner-detail 5\
--roundabouts.guess --remove-edges.isolated\
--no-internal-links --keep-edges.by-vclass passenger\
--remove-edges.by-vclass hov,tram,rail,rail_urban,rail_fast,pedestrian,bicycle\
--no-internal-links --keep-edges.by-vclass passenger,truck,bicycle\
--remove-edges.by-vclass hov,tram,rail,rail_urban,rail_fast,pedestrian\
--output.original-names --output.street-names\
--osm.lane-access true --osm.bike-access true\
--proj "+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"\
--osm-files $< -o=$@


$p/berlin-$V-network.xml.gz: input/sumo.net.xml
$(sc) prepare network-from-sumo $< --target-crs $(CRS) --output $@

$(sc) prepare clean-network $@ --output $@ --modes car
$(sc) prepare clean-network $@ --output $@ --modes car,ride,truck

$(sc) prepare reproject-network\
--input $@ --output $@\
--input-crs $(CRS) --target-crs $(CRS)\
--mode truck=freight\

$(sc) prepare apply-network-params freespeed capacity\
--network $@ --output $@\
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<artifactId>matsim-all</artifactId>

<!-- PR-labelled release -->
<!-- <version>16.0-PR3129</version>-->
<version>16.0-PR3185</version>

<!-- snapshot == not recommended: rather use PR-labelled release!-->
<version>16.0-PR3184</version>
<!-- <version>16.0-SNAPSHOT</version>-->
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -374,7 +374,7 @@
<goal>shade</goal>
</goals>
<configuration>
<outputFile>${project.basedir}/${project.build.finalName}-${git.commit.id.abbrev}.jar</outputFile>
<outputFile>${project.basedir}/${project.build.finalName}-${git.commit.id.describe}.jar</outputFile>
<transformers>
<!-- This bit sets the main class for the executable jar as you otherwise would with the assembly plugin -->
<transformer
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/org/matsim/prepare/ReprojectNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.scenario.ScenarioUtils;
import org.matsim.core.utils.geometry.CoordUtils;
import org.matsim.pt.transitSchedule.api.TransitScheduleWriter;
import picocli.CommandLine;

import java.nio.file.Path;
Expand All @@ -24,18 +23,12 @@ public class ReprojectNetwork implements MATSimAppCommand {
@CommandLine.Option(names = "--input", description = "Path to input network", required = true)
private Path input;

@CommandLine.Option(names = "--transit-schedule", description = "Path to input transit schedule", required = true)
private Path transitSchedule;

@CommandLine.Option(names = "--output", description = "Desired output path", required = true)
private Path output;

@CommandLine.Option(names = "--mode", description = "Remap existing modes in the network", required = false, split = ",")
private Map<String, String> remapModes;

@CommandLine.Option(names = "--output-transit", description = "Desired output path", required = true)
private Path outputTransit;

@CommandLine.Mixin
private CrsOptions crs;

Expand All @@ -52,9 +45,6 @@ public Integer call() throws Exception {
config.network().setInputFile(input.toString());
config.network().setInputCRS(crs.getInputCRS());

config.transit().setInputScheduleCRS(crs.getInputCRS());
config.transit().setTransitScheduleFile(transitSchedule.toString());

// Scenario loader does the reprojection for the network
Scenario scenario = ScenarioUtils.loadScenario(config);

Expand All @@ -78,10 +68,6 @@ public Integer call() throws Exception {

NetworkUtils.writeNetwork(scenario.getNetwork(), output.toString());

TransitScheduleWriter writer = new TransitScheduleWriter(scenario.getTransitSchedule());
writer.writeFile(outputTransit.toString());


return 0;
}
}

0 comments on commit 1b621d8

Please sign in to comment.