-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvements for pt schedule generation
- Loading branch information
Showing
13 changed files
with
118 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
UTF-8 |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] | ||
PROJCS["ETRS_1989_UTM_Zone_32N",GEOGCS["GCS_ETRS_1989",DATUM["D_ETRS_1989",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",9.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'> | ||
<qgis version="3.38.2-Grenoble"> | ||
<identifier></identifier> | ||
<parentidentifier></parentidentifier> | ||
<language></language> | ||
<type></type> | ||
<title></title> | ||
<abstract></abstract> | ||
<links/> | ||
<dates/> | ||
<fees></fees> | ||
<encoding></encoding> | ||
<crs> | ||
<spatialrefsys nativeFormat="Wkt"> | ||
<wkt></wkt> | ||
<proj4></proj4> | ||
<srsid>0</srsid> | ||
<srid>0</srid> | ||
<authid></authid> | ||
<description></description> | ||
<projectionacronym></projectionacronym> | ||
<ellipsoidacronym></ellipsoidacronym> | ||
<geographicflag>false</geographicflag> | ||
</spatialrefsys> | ||
</crs> | ||
<extent/> | ||
</qgis> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/org/matsim/prepare/pt/CorrectRouteTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.matsim.prepare.pt; | ||
|
||
import com.conveyal.gtfs.model.Route; | ||
|
||
import java.util.function.Consumer; | ||
import java.util.regex.Pattern; | ||
|
||
/** | ||
* Apply better tags to the route types to have more differentiated vehicle types. | ||
*/ | ||
@SuppressWarnings("unused") | ||
public class CorrectRouteTypes implements Consumer<Route> { | ||
|
||
private static final Pattern ICE = Pattern.compile("ICE [0-9]+"); | ||
private static final Pattern IC = Pattern.compile("(IC|EC) [0-9]+"); | ||
private static final Pattern RE = Pattern.compile("((RE|RB[0-9]+)|FEX|^RE)"); | ||
|
||
private static final Pattern S_BAHN = Pattern.compile("S[0-9]+"); | ||
private static final Pattern U_BAHN = Pattern.compile("U[0-9]+"); | ||
|
||
@Override | ||
public void accept(Route route) { | ||
// Check for name and the initial simple route type | ||
if (S_BAHN.matcher(route.route_short_name).matches() && route.route_type == 2) { | ||
route.route_type = 109; | ||
} else if (U_BAHN.matcher(route.route_short_name).matches() && route.route_type == 1) { | ||
route.route_type = 402; | ||
} | ||
|
||
// 101 ICE | ||
if (ICE.matcher(route.route_short_name).matches() && route.route_type == 2) { | ||
route.route_type = 101; | ||
} | ||
|
||
// 102 InterCity/EuroCity | ||
if (IC.matcher(route.route_short_name).matches() && route.route_type == 2) { | ||
route.route_type = 102; | ||
} | ||
|
||
// 106 Regionalzug | ||
if (RE.matcher(route.route_short_name).matches() && route.route_type == 2) { | ||
route.route_type = 106; | ||
} | ||
|
||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/org/matsim/prepare/pt/CorrectStopLocations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.matsim.prepare.pt; | ||
|
||
import com.conveyal.gtfs.model.Stop; | ||
|
||
import java.util.function.Consumer; | ||
|
||
/** | ||
* Correct stops that are wrong in the input data. | ||
*/ | ||
@SuppressWarnings("unused") | ||
public class CorrectStopLocations implements Consumer<Stop> { | ||
|
||
@Override | ||
public void accept(Stop stop) { | ||
|
||
// Harpe, Ort | ||
if (stop.stop_id.equals("240019")) { | ||
stop.stop_lat = 52.8519613; | ||
stop.stop_lon = 10.8828626; | ||
} | ||
|
||
// Quastenberger Damm | ||
if (stop.stop_id.equals("490866")) { | ||
stop.stop_lat = 53.4978109; | ||
stop.stop_lon = 13.3297704; | ||
} | ||
} | ||
|
||
} |