kopia lustrzana https://github.com/openmaptiles/openmaptiles
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: ![image](https://user-images.githubusercontent.com/3254090/129431491-9acbaeca-bf18-4384-8177-2c198834865c.png)pull/1180/head
rodzic
fdb9ae58cd
commit
45d825e212
|
@ -92,6 +92,10 @@ service_field: &service
|
|||
key: service
|
||||
name: service
|
||||
type: string
|
||||
access_field: &access
|
||||
key: access
|
||||
name: access
|
||||
type: string
|
||||
usage_field: &usage
|
||||
key: usage
|
||||
name: usage
|
||||
|
@ -183,6 +187,7 @@ tables:
|
|||
- *oneway
|
||||
- *area
|
||||
- *service
|
||||
- *access
|
||||
- *usage
|
||||
- *public_transport
|
||||
- *man_made
|
||||
|
|
|
@ -20,6 +20,7 @@ CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int)
|
|||
oneway int,
|
||||
brunnel text,
|
||||
service text,
|
||||
access text,
|
||||
layer int,
|
||||
level int,
|
||||
indoor int,
|
||||
|
@ -57,6 +58,7 @@ SELECT osm_id,
|
|||
is_oneway::int AS oneway,
|
||||
brunnel(is_bridge, is_tunnel, is_ford) AS brunnel,
|
||||
NULLIF(service, '') AS service,
|
||||
access,
|
||||
NULLIF(layer, 0) AS layer,
|
||||
"level",
|
||||
CASE WHEN indoor = TRUE THEN 1 END AS indoor,
|
||||
|
@ -77,6 +79,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
NULL AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -107,6 +110,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
NULL AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -137,6 +141,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
NULL AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -167,6 +172,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
NULL AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -197,6 +203,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
NULL AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -227,6 +234,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -257,6 +265,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -287,6 +296,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
NULL AS service,
|
||||
access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -319,6 +329,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
public_transport,
|
||||
service_value(service) AS service,
|
||||
CASE WHEN access IN ('private', 'no') THEN 'no' END AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -368,6 +379,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
NULL::boolean AS is_bridge,
|
||||
NULL::boolean AS is_tunnel,
|
||||
NULL::boolean AS is_ford,
|
||||
|
@ -401,6 +413,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
NULL::boolean AS is_bridge,
|
||||
NULL::boolean AS is_tunnel,
|
||||
NULL::boolean AS is_ford,
|
||||
|
@ -434,6 +447,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -466,6 +480,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -498,6 +513,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -531,6 +547,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -564,6 +581,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -595,6 +613,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -625,6 +644,7 @@ FROM (
|
|||
shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -655,6 +675,7 @@ FROM (
|
|||
shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -686,6 +707,7 @@ FROM (
|
|||
shipway,
|
||||
NULL AS public_transport,
|
||||
service_value(service) AS service,
|
||||
NULL::text AS access,
|
||||
is_bridge,
|
||||
is_tunnel,
|
||||
is_ford,
|
||||
|
@ -721,6 +743,7 @@ FROM (
|
|||
NULL AS shipway,
|
||||
public_transport,
|
||||
NULL AS service,
|
||||
NULL::text AS access,
|
||||
CASE
|
||||
WHEN man_made IN ('bridge') THEN TRUE
|
||||
ELSE FALSE
|
||||
|
|
|
@ -146,6 +146,13 @@ layer:
|
|||
- driveway
|
||||
- alley
|
||||
- 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:
|
||||
description: |
|
||||
Original value of the [`layer`](http://wiki.openstreetmap.org/wiki/Key:layer) tag.
|
||||
|
@ -180,7 +187,7 @@ layer:
|
|||
datasource:
|
||||
geometry_field: geometry
|
||||
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:
|
||||
- ./network_type.sql
|
||||
- ./class.sql
|
||||
|
|
|
@ -29,10 +29,14 @@ SELECT (ST_Dump(ST_LineMerge(ST_Collect(geometry)))).geom AS geometry,
|
|||
foot,
|
||||
horse,
|
||||
mtb_scale,
|
||||
CASE
|
||||
WHEN access IN ('private', 'no')
|
||||
THEN 'no'
|
||||
ELSE NULL::text END AS access,
|
||||
layer
|
||||
FROM osm_highway_linestring_gen_z11
|
||||
-- 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 */;
|
||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z11_geometry_idx
|
||||
ON osm_transportation_merge_linestring_gen_z11 USING gist (geometry);
|
||||
|
@ -53,6 +57,7 @@ SELECT ST_Simplify(geometry, ZRes(12)) AS geometry,
|
|||
foot,
|
||||
horse,
|
||||
mtb_scale,
|
||||
access,
|
||||
layer
|
||||
FROM osm_transportation_merge_linestring_gen_z11
|
||||
WHERE highway NOT IN ('tertiary', 'tertiary_link')
|
||||
|
@ -77,6 +82,7 @@ SELECT ST_Simplify(geometry, ZRes(11)) AS geometry,
|
|||
foot,
|
||||
horse,
|
||||
mtb_scale,
|
||||
access,
|
||||
layer
|
||||
FROM osm_transportation_merge_linestring_gen_z10
|
||||
-- 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
|
||||
construction IN ('motorway', 'trunk', 'primary'))
|
||||
AND ST_IsValid(geometry)
|
||||
AND access IS NULL
|
||||
GROUP BY highway, network, construction, is_bridge, is_tunnel, is_ford
|
||||
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
|
||||
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z8_geometry_idx
|
||||
|
|
Ładowanie…
Reference in New Issue