Return railways in transportation

This commit is contained in:
Lukas Martinelli
2016-11-26 21:08:30 +00:00
parent 24b1e763fa
commit e9f4c31e0a
4 changed files with 33 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
-- etldoc: label="layer_transportation_name | <z8> z8 |<z9> z9 |<z10> z10 |<z11> z11 |<z12> z12|<z13> z13|<z14_> z14_" ] ;
CREATE OR REPLACE FUNCTION layer_transportation_name(bbox geometry, zoom_level integer)
RETURNS TABLE(osm_id bigint, geometry geometry, name text, ref text, ref_length int, class highway_class, subclass text) AS $$
RETURNS TABLE(osm_id bigint, geometry geometry, name text, ref text, ref_length int, class text, subclass text) AS $$
SELECT osm_id, geometry, name,
NULLIF(ref, ''), NULLIF(LENGTH(ref), 0) AS ref_length,
to_highway_class(highway) AS class, highway AS subclass
@@ -29,7 +29,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, ref text, ref_length
SELECT * FROM osm_transportation_name_linestring
WHERE zoom_level = 12
AND LineLabel(zoom_level, COALESCE(NULLIF(name, ''), ref), geometry)
AND to_highway_class(highway) < 'minor_road'::highway_class
AND to_highway_class(highway) NOT IN ('minor_road', 'path')
AND NOT highway_is_link(highway)
UNION ALL
@@ -37,7 +37,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, ref text, ref_length
SELECT * FROM osm_transportation_name_linestring
WHERE zoom_level = 13
AND LineLabel(zoom_level, COALESCE(NULLIF(name, ''), ref), geometry)
AND to_highway_class(highway) < 'path'::highway_class
AND to_highway_class(highway) <> 'path'
UNION ALL
-- etldoc: osm_transportation_name_linestring -> layer_transportation_name:z14_