Subway Preprocessor and Validator
Find a file
Claudius 21641babe7
Update v2h_templates.py
Added some CSS styling to support highlighting a row on hover. Also applying a max width to the table to prevent the country table to grow too wide
2019-05-14 22:22:24 +02:00
checkers Magic numbers convered to constants; clarifying coordinate comparison 2019-03-21 15:33:16 +03:00
processors Decorator renamed; small fixes 2019-03-22 15:55:46 +03:00
scripts Caching transfers in good cities 2019-02-12 13:05:04 +03:00
stop_areas Fix a small error in make_tram_areas 2018-08-01 21:47:51 +03:00
.gitignore Add build_city.sh script 2018-01-29 13:56:32 +03:00
css_colours.py Resolving CSS colours 2017-11-01 11:48:45 +03:00
LICENSE Initial commit 2017-10-04 15:58:58 +03:00
process_subways.py Start working on good cities cache 2019-02-08 01:12:44 +03:00
README.md Update README file 2019-04-23 14:46:01 +03:00
subway_structure.py Moved all actions with city cache into a class. This class not only encapsulates the cache logic but also skips cache maintaining in case when --cache command line option is omitted. 2019-03-14 15:27:37 +03:00
v2h_templates.py Update v2h_templates.py 2019-05-14 22:22:24 +02:00
validation_to_html.py Support for trams 2018-07-20 19:40:08 +03:00

Subway Preprocessor

Here you see a list of scripts that can be used for preprocessing all the metro systems in the world from OpenStreetMap. subway_structure.py produces a list of disjunct systems that can be used for routing and for displaying of metro maps.

How To Validate

  • Download or update a planet file in o5m format (using osmconvert and osmupdate).
  • Use osmfilter to extract a portion of data for all subways.
  • Run process_subways.py with appropriate set of command line arguments to build metro structures and receive a validation log.
  • Run validation_to_html.py on that log to create readable HTML tables.

Validation Script

There is a process_subways.sh in the scripts directory. The author uses it for updating both the planet and a city he's working on. Here is an example of a script for updating the London Underground network:

PLANET_PATH=$HOME/osm/planet
export OSMCTOOLS="$PLANET_PATH"
export PLANET="$PLANET_PATH/london.o5m"
export HTML_DIR=tmp_html
export BBOX=-0.681152,51.286758,0.334015,51.740636
export CITY="London"
export DUMP=london.yaml

scripts/process_subways.sh

The bounding box can be found in the Google Spreadsheet.

This can be simplified by using the build_city.sh script, which fetches the bbox from the web:

scripts/build_city.sh london.o5m London

Daily updates of validation results are available at this website.

Adding Stop Areas To OSM

To quickly add stop_area relations for the entire city, use the make_stop_areas.py script from the stop_area directory. Give it a bounding box or a .json file download from Overpass API. It would produce an JOSM XML file that you should manually check in JOSM. After that just upload it.

Author and License

All scripts were written by Ilya Zverev for MAPS.ME. Published under Apache Licence 2.0.