-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render type=restriction and restriction:bicycle=give_way #4
Comments
Quick overview of such relations:
|
La France pays du fromage et des CLPC |
I am not sure the "to" arrow is important as it can be mostly deduced from the street layout. I would just mark the "from" location to reduce clutter |
For the record, They can however be recovered from the raw -- Fetches completely a restriction:bicycle=give_wau relation from osm2pgsql
-- tables layout. Read comment from innermost to outermost.
-- Fill in details for the "via" node using dedicated table
-- planet_osm_point
SELECT
data.from_original_id,
data.from_id,
data.from_way,
data.to_original_id,
data.to_id,
data.to_way,
data.via AS via_original_id,
planet_osm_point.osm_id AS via_id,
planet_osm_point.way AS via_way
FROM
planet_osm_point,
(
-- Fill in details for the "to" way using dedicated table
-- planet_osm_line
SELECT
data.from_original_id,
data.from_id,
data.from_way,
data.to AS to_original_id,
planet_osm_line.osm_id AS to_id,
planet_osm_line.way AS to_way,
data.via
FROM
planet_osm_line,
(
-- Fill in details for the "from" way using dedicated table
-- planet_osm_line
SELECT
data.from AS from_original_id,
planet_osm_line.osm_id AS from_id,
planet_osm_line.way AS from_way,
data.to,
data.via
FROM
planet_osm_line,
(
-- Ensure the restriction:bicycle=give_way relation is
-- correct with both from and to as ways and via as
-- node.
SELECT
id,
LTRIM("from", 'w') AS from,
LTRIM("via", 'n') AS via,
LTRIM("to", 'w') AS to
FROM (
-- Select restriction:bicycle=give_way relations from relations table
-- This table only includes nodes and ways ids, not
-- the geometry nor references to the objects in
-- the dedicated tables.
SELECT
id,
members[array_position(members, 'from') - 1] AS from,
members[array_position(members, 'via') - 1] AS via,
members[array_position(members, 'to') - 1] AS to
FROM planet_osm_rels
WHERE
tags @> ARRAY['type', 'restriction', 'restriction:bicycle', 'give_way']
) AS data
WHERE
data.from IS NULL OR data.from LIKE 'w%'
AND data.via IS NULL OR data.via LIKE 'n%'
AND data.to IS NULL OR data.to LIKE 'w%'
ORDER BY id -- TODO
LIMIT 10 -- TODO
) AS data
WHERE
planet_osm_line.osm_id = data.from::integer
) AS data
WHERE
planet_osm_line.osm_id = data.to::integer
) AS data
WHERE
planet_osm_point.osm_id = data.via::integer
; Styling this is not a big deal then. The main issue is that the innermost SQL lookup ( |
No description provided.
The text was updated successfully, but these errors were encountered: