Add network to transport layer (#1158)
Closes #1153 This PR populates the existing `network_type` field in the route table with highway route network information, using the most important value in cases of concurrencies. In order to expose this value, two files `network_type.sql` and `update_route_member.sql` were moved from the `transportation_name` layer to the `transportation` layer. Below is a representative zoom level 6 with motorways only shown for `us-interstate` network types. This sample was generated from this PR using a [custom branch](https://github.com/ZeLonewolf/openstreetmap-americana/tree/selective-highway-zoom) of openstreetmap-americana. This provides a simplified rendering of the highway network which excludes many minor motorway roads and sections.  Below is zoom level 6 on the current [openstreetmap-americana](https://zelonewolf.github.io/openstreetmap-americana/#6/42.148/-73.712). Notice the many additional stubs, motorway islands, and minor routes which are present. Instead of rendering `highway=trunk` to make this network look nice, we can instead suppress non-interstate roads and withhold motorway+trunk rendering to a closer zoom: 
This commit is contained in:
committed by
GitHub
parent
9e4be3e3b0
commit
08bb2a06c0
@@ -15,6 +15,7 @@ CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int)
|
||||
geometry geometry,
|
||||
class text,
|
||||
subclass text,
|
||||
network text,
|
||||
ramp int,
|
||||
oneway int,
|
||||
brunnel text,
|
||||
@@ -47,6 +48,7 @@ SELECT osm_id,
|
||||
THEN COALESCE(NULLIF(public_transport, ''), highway)
|
||||
WHEN aerialway IS NOT NULL THEN aerialway
|
||||
END AS subclass,
|
||||
NULLIF(network, '') AS network,
|
||||
-- All links are considered as ramps as well
|
||||
CASE
|
||||
WHEN highway_is_link(highway) OR highway = 'steps'
|
||||
@@ -69,6 +71,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -98,6 +101,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -127,6 +131,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -156,6 +161,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -185,6 +191,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -214,6 +221,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -243,6 +251,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -272,6 +281,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -303,6 +313,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
construction,
|
||||
network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -351,6 +362,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -383,6 +395,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -415,6 +428,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -446,6 +460,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -477,6 +492,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -509,6 +525,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -541,6 +558,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
NULL AS railway,
|
||||
aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -571,6 +589,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
NULL AS railway,
|
||||
aerialway,
|
||||
NULL AS shipway,
|
||||
@@ -600,6 +619,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
shipway,
|
||||
@@ -629,6 +649,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
shipway,
|
||||
@@ -659,6 +680,7 @@ FROM (
|
||||
geometry,
|
||||
NULL AS highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
shipway,
|
||||
@@ -693,6 +715,7 @@ FROM (
|
||||
geometry,
|
||||
highway,
|
||||
NULL AS construction,
|
||||
NULL AS network,
|
||||
NULL AS railway,
|
||||
NULL AS aerialway,
|
||||
NULL AS shipway,
|
||||
|
||||
Reference in New Issue
Block a user