|
1 | 1 | # Open Street Map Public Transport Parser |
2 | 2 |
|
| 3 | +A tool to parse broken/disconnected relations from openstreetmap, reconnect them with some tolerance, sort the internal points, and output them as GeoJSON linestrings. |
| 4 | + |
| 5 | +It can understand and reconstruct |
| 6 | + - relations that represent public transport v2 |
| 7 | + - ways and relations that represent areas |
| 8 | + |
| 9 | +Blazing fast by design: every step in the process pipeline is fully parallelized for maximum speed using all available cpus by default. |
| 10 | + |
| 11 | +### How it works |
| 12 | + |
| 13 | +1. Reads data from a .pbf file, extracting ways and relations filtered by attributes specified via the `--filter` argument. |
| 14 | +2. Processes each relation as follows: |
| 15 | + 1. Sorts all the ways within the relation based on proximity. |
| 16 | + 2. Joins ways that share identical lat/lng coordinates at their first or last nodes, combining them into a single LineString. |
| 17 | + 3. If multiple LineStrings remain after this step: |
| 18 | + - It checks for gaps. |
| 19 | + - If the gaps are smaller than the specified gap threshold (in meters, default: 150), they are joined into one LineString. |
| 20 | +3. Outputs a JSON array, with one GeoJSON feature per way or relation found, including: |
| 21 | + - For areas: a single LineString or MultiLineString feature. |
| 22 | + - For public transport: a LineString representing the full path and an array of points representing the stops. |
| 23 | + |
| 24 | +[See the blogpost](https://jperelli.com.ar/post/2019/08/12/oxidizing-cualbondi/) for a very detailed description |
| 25 | + |
| 26 | +### Status |
| 27 | + |
3 | 28 | [](https://github.com/cualbondi/osmptparser/actions) |
4 | 29 | [](https://codecov.io/gh/cualbondi/osmptparser) |
5 | 30 |
|
6 | | -## Test how it works |
| 31 | +## Try it |
7 | 32 |
|
8 | 33 | ``` |
9 | 34 | git clone git@github.com:cualbondi/osmptparser.git |
|
0 commit comments