Giter Club home page Giter Club logo

osmi_pubtrans3's Introduction

OSMI Public Transport 3

This repository contains the programme which generates the data which powers the Public Transport views of OpenStreetMap Inspector. It is called version 3 because it replaces two older (unpublished) implementations. The main difference to its predecessors is that it supports the current tagging schemes.

This software uses the Osmium library by Jochen Topf for everything related with reading OSM data and the GDAL library (via Jochen Topf's C++ wrapper gdalcpp) to write the output data.

License and Authors

This software was developed by Geofabrik GmbH. See the Git history for a full list of contributors.

This software is licensed under the terms of GNU General Public License version 3 or newer. See LICENSE.md for the full legal text of the license.

The Catch unit test framework is available under the terms of Boost Software License.

How it works

This software reads an OpenStreetMap planet dump (or one of its smaller extracts) and produces an Spatialite database which contains all errorenous objects which were found in the OpenStreetMap data. Other output formats than Spatialite are possible but not as well tested. You can open the output files using QGIS.

The SpatiaLite database is used as the data source of the WMS service by the OSMI backend. This service provides the map and an GetFeatureInfo API call used by the frontend.

Output

The documentation of the contents of the SQlite file can be found at output-documentation.md.

Dependencies

  • C++11 compiler
  • libosmium (libosmium-dev) and all its important dependencies
  • GDAL library (libgdal-dev)
  • proj.4 (libproj4-dev)
  • CMake (cmake)

You can install libosmium either using your package manager or just cloned from its Github repository to any location on your disk. Add a symlink libosmium in the top level directory of this repository to the location of libosmium/include if you use the latter variant. Take care to use libosmium v2.x not the old Osmium v1.x!

Building

mkdir build
cd build
cmake ..
make

To run the unit tests:

make test

The unit tests write temporary files to build/test/. If the tests run properly, they clean up these files. Otherwise run rm build/tests/.tmp.* manually. If a test fails because a check fails, the temporary files are clean up.

Usage

Run ./osmi_pubtrans3 -h to see the available options.

There are two binaries. osmi_pubtrans3_merc can only produce output files in Web Mercator projection (EPSG:3857) but is faster than osmi_pubtrans3 because it uses a faster coordinate transformation engine provided by libosmium while osmi_simple_views calls Proj4.

osmi_pubtrans3's People

Contributors

d3d9 avatar grischard avatar nakaner avatar urbalazs avatar woodpeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osmi_pubtrans3's Issues

Routes without way members with empty roles

If you route only has no way members which have an empty role (i.e. route with forward, backward or both roles but valid stops and platforms), the error message reads like "route has only stops/platforms" but that is wrong. The error message should be rephrased.

Error fields aren't obvious or documented

While some of these are comprehensible, I have no idea what some of the others are:

error_over_non_rail
error_over_rail
error_unordered_gap
error_wrong_structure
no_stops_pltf_at_begin
stoppltf_after_route
non_way_empty_role
stop_not_on_way
no_way_members
unknown_role
unknown_route_type
stop_is_not_node

Route inspector does not recognize entry_only or exit_only stops

PTv2 spec specifies that one should tag stop_entry_only or stop_exit_only for first and last stops respectively. But OSMI does not recognize these roles in route relations .

OSMI gives the error No stop or platform as first member = true if first stop role is stop_entry_only or platform_entry_only

Example rel_id=11599082

hail_and_ride is not recognized as valid role for bus route

title says it all, I'm using the view public transport - routes to highlight whenever a route in my area becomes broken. unfortunately this works properly only for urban buses, where no section is "hail_and_ride". for rural bus routes, they all fail the role test.

if I understand the logic, we have two types of way members, one set where the roles would identify the way as a platform, one set where the roles would identify the way as a route section. as of now, members of this second set are only allowed the empty role, while I need 'hail_and_ride' to be accepted as well.

in this example area one route now correctly passes all tests, two more routes should pass all tests (now failing the unknown_role test), one route should fail the no_stops_pltf_at_begin test as it indeed does now.

bus_guideway

In the "Public Transport - Routes" layer of OSM Inspector, bus routes that run along highway=bus_guideway are flagged with the error_over_rail error.

Is it possible to not flag bus routes that use bus_guideways?

Add missing stations check to subways

Quite often, one or several stations drop out of a route. This can be quite easily detected for a backward+forward pair of routes in a route_master:

A -->-- B -->-- C -->-- D
A --<-- B --<-------<-- D

While this situation may often take place in reality, for subway routes this almost always signals about an error.

Since 2018, I have occasionally corrected such errors. Over the past two months, laborious work has been done to find them in nearly 300 subway and other rapid transit networks. As a result, about 150 stations were added to routes even in such well-mapped cities as Madrid, Stockholm, Warsaw, New York, Stuttgart, Munich S-Bahn, etc. There were about 10% false positives, mostly on routes of train type.

This became possible after adding missing station search algorithm to the Subway validator. I suggest implementing the same check in your validator.

railway=preserved

railway=preserved should be treated as a valid tag for route=train.

Invalid route flagged but no data provided that is triggering the invalid route.

I have two route relations, 4547782 and 4547783, among others relations that I have used osmi_inspector maintain validity. On 4/6/2021 I corrected a "stop not on way" error for both routes. It appeared that I mixed up two stops at a bus station via cloning of the routes. Thank you for this additional check. However, today, 4/7/2021, the routes are marked as invalid but no error text has been provided.

  • I checked that the two stops and platforms are in the correct order.
  • These nodes are at the beginning of the route relation table.
  • The nodes have either stop or platform as the role in the relation.
  • The route has no gaps or members out of order.
  • The last update to the osm wiki page is 2017.

There is no information to tell me how to fix this invalid state. Is this a bug or are there some documentation items missing from the wiki page to tell me how to fix the reported issue with these relations?

layer:	ptv2_routes_invalid
rel_id:	4547783
from:	
to:	
via:	
ref:	SR 51 OB
name:	bus SR 51 Rapid OB
route:	bus
operator:	Valley Metro Org
error_over_non_rail:	             <===== Nothing listed.
error_over_rail:	
error_unordered_gap:	
error_wrong_structure:	
no_stops_pltf_at_begin:	
stoppltf_after_route:	
non_way_empty_role:	
stop_not_on_way:	
no_way_members:	
unknown_role:	
unknown_route_type:	
stop_is_not_node:	
error_over_non_ferry:	

Support route=light_rail

Currently some routes (e.g. rel_id: 2806129) are marked as invalid because of the tag route=light_rail being an "unknown_route_type".
Would be nice to see them as valid routes.

Suggestion: Add checks for route=road

Road routes (relations with route=road) are quite common in OSM. It would be nice if these can also be validated by OSM inspector. I think it is mainaly gabs in the order that needs to be searched for.

I think the best option is to add a new view for it (in the same dropdown where you now select for for example "routing" or "public transport").

I hope you can consider it because it would help validating those relations a lot.

Confusing error message when relations use a way under construction

If a bus route has a way tagged as "highway=construction", this flags a warning. Fine!
scrot_202302281057 20

But the report about the route gives this warning instead: "Street vehicle route over railways = true"
scrot_202302281057 32

The situation also arises for rail routes, should someone change one of the ways into railway=construction. It is still considered as a railway but the report will say "Railway route over roads = true".

Fine-granular distinction of invalid routes on HMI

Currently only valid/invalid can selected on the HMI.
It would be nice to have more categories (stop order, rail error, route gap, ..) to easily see only routes with the error(s).
Might be tricky as routes can have multiple of these errors.
More a nice to have feature-request as the information is available in the route details.

Trolley wire is not required for trolley buses

The new trolley buses can operate without trolley wire using the built-in battery. Due to this fact, no trolley wire is required in short distances. Please check this area in Budapest, Hungary. This error report error: trolley bus without trolley wire cannot be fixed, because the road has no trolley wire at all. The trolley buses operates here by using battery.

I suggest to add an exception to the validator: if trolley_wire=no is mapped, no error message is displayed. Please add a hint in the error message to the mapper, how can they dismiss this kind of error by adding trolley_wire=no.

If there is a trolley bus route and no trolley_wire=* key is added, the error message should be still there.

Route inspector does not recognize roundabout=circular

There are multiple routes which are marked as invalid (Way members unordered or missing) all going through a junction which is correctly tagged as junction=circular.
See here
The relations (e.g. 388113 or 390963) seem fine in josm.

I would expect to handle it similar to junction=roundabout.

Route mistakingly flagged as having misorderered stops when a road is included twice

Consider this bus route with the ref 215. It is flagged as having misordered stops, which isn't the case.

My guess is that the error lies within this:

  • the route first passes over the stop position for the northern stop direction without stopping there
  • then over that for the southern direction with stopping there
  • then the single stop further south next to the church
  • then returning to the stop for the northern direction and stopping there

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.