Implement private road tagging (#1174)
Fixes #1066 This PR adds a new field `access` in the transportation layer, which will be set to `no` if the `access` tag is either `no` or `private`. While `private` is the more popular value by a 17:1 ratio, I went with `no` because it's smaller in the tiles. In addition, the text `no` opens up the future possibility of other text-based access values such as `destination`, `customers`, or `permit`. The screenshot below shows an example of access tagging for a road on a military base: 
This commit is contained in:
parent
fdb9ae58cd
commit
45d825e212
@ -92,6 +92,10 @@ service_field: &service
|
|||||||
key: service
|
key: service
|
||||||
name: service
|
name: service
|
||||||
type: string
|
type: string
|
||||||
|
access_field: &access
|
||||||
|
key: access
|
||||||
|
name: access
|
||||||
|
type: string
|
||||||
usage_field: &usage
|
usage_field: &usage
|
||||||
key: usage
|
key: usage
|
||||||
name: usage
|
name: usage
|
||||||
@ -183,6 +187,7 @@ tables:
|
|||||||
- *oneway
|
- *oneway
|
||||||
- *area
|
- *area
|
||||||
- *service
|
- *service
|
||||||
|
- *access
|
||||||
- *usage
|
- *usage
|
||||||
- *public_transport
|
- *public_transport
|
||||||
- *man_made
|
- *man_made
|
||||||
|
|||||||
@ -20,6 +20,7 @@ CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int)
|
|||||||
oneway int,
|
oneway int,
|
||||||
brunnel text,
|
brunnel text,
|
||||||
service text,
|
service text,
|
||||||
|
access text,
|
||||||
layer int,
|
layer int,
|
||||||
level int,
|
level int,
|
||||||
indoor int,
|
indoor int,
|
||||||
@ -57,6 +58,7 @@ SELECT osm_id,
|
|||||||
is_oneway::int AS oneway,
|
is_oneway::int AS oneway,
|
||||||
brunnel(is_bridge, is_tunnel, is_ford) AS brunnel,
|
brunnel(is_bridge, is_tunnel, is_ford) AS brunnel,
|
||||||
NULLIF(service, '') AS service,
|
NULLIF(service, '') AS service,
|
||||||
|
access,
|
||||||
NULLIF(layer, 0) AS layer,
|
NULLIF(layer, 0) AS layer,
|
||||||
"level",
|
"level",
|
||||||
CASE WHEN indoor = TRUE THEN 1 END AS indoor,
|
CASE WHEN indoor = TRUE THEN 1 END AS indoor,
|
||||||
@ -77,6 +79,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
NULL AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -107,6 +110,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
NULL AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -137,6 +141,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
NULL AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -167,6 +172,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
NULL AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -197,6 +203,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
NULL AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -227,6 +234,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -257,6 +265,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -287,6 +296,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -319,6 +329,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
public_transport,
|
public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
CASE WHEN access IN ('private', 'no') THEN 'no' END AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -368,6 +379,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel,
|
NULL::boolean AS is_tunnel,
|
||||||
NULL::boolean AS is_ford,
|
NULL::boolean AS is_ford,
|
||||||
@ -401,6 +413,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel,
|
NULL::boolean AS is_tunnel,
|
||||||
NULL::boolean AS is_ford,
|
NULL::boolean AS is_ford,
|
||||||
@ -434,6 +447,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -466,6 +480,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -498,6 +513,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -531,6 +547,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -564,6 +581,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -595,6 +613,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -625,6 +644,7 @@ FROM (
|
|||||||
shipway,
|
shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -655,6 +675,7 @@ FROM (
|
|||||||
shipway,
|
shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -686,6 +707,7 @@ FROM (
|
|||||||
shipway,
|
shipway,
|
||||||
NULL AS public_transport,
|
NULL AS public_transport,
|
||||||
service_value(service) AS service,
|
service_value(service) AS service,
|
||||||
|
NULL::text AS access,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel,
|
is_tunnel,
|
||||||
is_ford,
|
is_ford,
|
||||||
@ -721,6 +743,7 @@ FROM (
|
|||||||
NULL AS shipway,
|
NULL AS shipway,
|
||||||
public_transport,
|
public_transport,
|
||||||
NULL AS service,
|
NULL AS service,
|
||||||
|
NULL::text AS access,
|
||||||
CASE
|
CASE
|
||||||
WHEN man_made IN ('bridge') THEN TRUE
|
WHEN man_made IN ('bridge') THEN TRUE
|
||||||
ELSE FALSE
|
ELSE FALSE
|
||||||
|
|||||||
@ -146,6 +146,13 @@ layer:
|
|||||||
- driveway
|
- driveway
|
||||||
- alley
|
- alley
|
||||||
- parking_aisle
|
- parking_aisle
|
||||||
|
access:
|
||||||
|
description: |
|
||||||
|
Access restrictions on this road. Supported values of the
|
||||||
|
[`access`](http://wiki.openstreetmap.org/wiki/Key:access) tag are `no` and `private`,
|
||||||
|
which resolve to `no`.
|
||||||
|
values:
|
||||||
|
- no
|
||||||
layer:
|
layer:
|
||||||
description: |
|
description: |
|
||||||
Original value of the [`layer`](http://wiki.openstreetmap.org/wiki/Key:layer) tag.
|
Original value of the [`layer`](http://wiki.openstreetmap.org/wiki/Key:layer) tag.
|
||||||
@ -180,7 +187,7 @@ layer:
|
|||||||
datasource:
|
datasource:
|
||||||
geometry_field: geometry
|
geometry_field: geometry
|
||||||
srid: 900913
|
srid: 900913
|
||||||
query: (SELECT geometry, class, subclass, network, oneway, ramp, brunnel, service, layer, level, indoor, bicycle, foot, horse, mtb_scale, surface FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t
|
query: (SELECT geometry, class, subclass, network, oneway, ramp, brunnel, service, access, layer, level, indoor, bicycle, foot, horse, mtb_scale, surface FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t
|
||||||
schema:
|
schema:
|
||||||
- ./network_type.sql
|
- ./network_type.sql
|
||||||
- ./class.sql
|
- ./class.sql
|
||||||
|
|||||||
@ -29,10 +29,14 @@ SELECT (ST_Dump(ST_LineMerge(ST_Collect(geometry)))).geom AS geometry,
|
|||||||
foot,
|
foot,
|
||||||
horse,
|
horse,
|
||||||
mtb_scale,
|
mtb_scale,
|
||||||
|
CASE
|
||||||
|
WHEN access IN ('private', 'no')
|
||||||
|
THEN 'no'
|
||||||
|
ELSE NULL::text END AS access,
|
||||||
layer
|
layer
|
||||||
FROM osm_highway_linestring_gen_z11
|
FROM osm_highway_linestring_gen_z11
|
||||||
-- mapping.yaml pre-filter: motorway/trunk/primary/secondary/tertiary, with _link variants, construction, ST_IsValid()
|
-- mapping.yaml pre-filter: motorway/trunk/primary/secondary/tertiary, with _link variants, construction, ST_IsValid()
|
||||||
GROUP BY highway, network, construction, is_bridge, is_tunnel, is_ford, bicycle, foot, horse, mtb_scale, layer
|
GROUP BY highway, network, construction, is_bridge, is_tunnel, is_ford, bicycle, foot, horse, mtb_scale, access, layer
|
||||||
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z11_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z11_geometry_idx
|
||||||
ON osm_transportation_merge_linestring_gen_z11 USING gist (geometry);
|
ON osm_transportation_merge_linestring_gen_z11 USING gist (geometry);
|
||||||
@ -53,6 +57,7 @@ SELECT ST_Simplify(geometry, ZRes(12)) AS geometry,
|
|||||||
foot,
|
foot,
|
||||||
horse,
|
horse,
|
||||||
mtb_scale,
|
mtb_scale,
|
||||||
|
access,
|
||||||
layer
|
layer
|
||||||
FROM osm_transportation_merge_linestring_gen_z11
|
FROM osm_transportation_merge_linestring_gen_z11
|
||||||
WHERE highway NOT IN ('tertiary', 'tertiary_link')
|
WHERE highway NOT IN ('tertiary', 'tertiary_link')
|
||||||
@ -77,6 +82,7 @@ SELECT ST_Simplify(geometry, ZRes(11)) AS geometry,
|
|||||||
foot,
|
foot,
|
||||||
horse,
|
horse,
|
||||||
mtb_scale,
|
mtb_scale,
|
||||||
|
access,
|
||||||
layer
|
layer
|
||||||
FROM osm_transportation_merge_linestring_gen_z10
|
FROM osm_transportation_merge_linestring_gen_z10
|
||||||
-- Current view: motorway/primary/secondary, with _link variants and construction
|
-- Current view: motorway/primary/secondary, with _link variants and construction
|
||||||
@ -100,6 +106,7 @@ FROM osm_transportation_merge_linestring_gen_z9
|
|||||||
WHERE (highway IN ('motorway', 'trunk', 'primary') OR
|
WHERE (highway IN ('motorway', 'trunk', 'primary') OR
|
||||||
construction IN ('motorway', 'trunk', 'primary'))
|
construction IN ('motorway', 'trunk', 'primary'))
|
||||||
AND ST_IsValid(geometry)
|
AND ST_IsValid(geometry)
|
||||||
|
AND access IS NULL
|
||||||
GROUP BY highway, network, construction, is_bridge, is_tunnel, is_ford
|
GROUP BY highway, network, construction, is_bridge, is_tunnel, is_ford
|
||||||
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z8_geometry_idx
|
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z8_geometry_idx
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user