tilezen / vector-datasource

Tilezen vector tile service - OpenStreetMap data in several formats
https://www.nextzen.org/
Other
507 stars 119 forks source link

Transit layer doesn't include railway=narrow_gauge and railway=monorail #531

Open nvkelso opened 8 years ago

nvkelso commented 8 years ago

The transit layer does not include railway=narrow_gauge and railway=monorail, while the roads layer does. Seems like they should be consistent (and pack them at zoom 10 like subway and light_rail).

roads.jinja2

              OR railway IN ('rail', 'tram', 'light_rail', 'narrow_gauge', 'monorail')

functions.sql

CREATE OR REPLACE FUNCTION mz_calculate_transit_level(route_val text)
RETURNS SMALLINT AS $$
BEGIN
    RETURN (
        CASE WHEN route_val IN ('train', 'railway') THEN 6
             WHEN route_val IN ('subway', 'light_rail', 'tram') THEN 10
             ELSE NULL END
    );
END;
$$ LANGUAGE plpgsql IMMUTABLE;
zerebubuth commented 8 years ago

This is comparing two different things: The roads query is looking at the railway key, but the transit query (via mz_calculate_transit_level) is looking at the route key.

The difference is that railway= is generally tagged on the way which represents the geometry of the physical track, whereas route= is generally tagged on a relation containing not only the collection of track geometries but also the stations and/or stops which make up a regular named service or line.

We should include route=monorail (49 instances) and route=narrow_gauge (2 instances), but we need to be clear that these are not the same tags - and we shouldn't expect a route=light_rail to necessarily contain all/only railway=light_rail.

Also, it looks like there are railway=subway ways (32,543 instances) - should we look at including those too?