Skip to content

Commit

Permalink
First render of CLPC
Browse files Browse the repository at this point in the history
  • Loading branch information
Phyks committed Aug 8, 2020
1 parent be42460 commit 6253be0
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
13 changes: 13 additions & 0 deletions amenities.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1231,3 +1231,16 @@
}
}
}

#clpc[zoom >= 19] {
marker-width: 30;
marker-file: url('symbols/clpc/right.svg');
[angle <= 45],
[angle >= 135][angle <= 225] {
marker-file: url('symbols/clpc/straight.svg');
marker-transform: 'translate(15, 15) rotate([angle])';
}
[angle > 45][angle < 135] {
marker-transform: 'translate(-15, 0) rotate([angle])';
}
}
39 changes: 39 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,45 @@ Layer:
geometry: point
properties:
minzoom: 10
- id: clpc
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
ST_Centroid(
ST_Intersection(
ST_Union(h1.way, h2.way),
ST_Difference(
ST_Buffer(ST_Intersection(h1.way, h2.way), 30),
ST_Buffer(ST_Intersection(h1.way, h2.way), 20)
)
)
) AS way,
CASE
WHEN members[array_position(members, CONCAT('w', h1.osm_id)) + 1] = 'from' THEN
cast(degrees(ST_Angle(h1.way, h2.way)) AS integer)
ELSE
cast(degrees(ST_Angle(h2.way, h1.way)) AS integer)
END AS angle
FROM
planet_osm_line h1
JOIN planet_osm_line h2 ON ST_Intersects(h1.way, h2.way)
JOIN planet_osm_rels r ON (
parts @> array[h1.osm_id, h2.osm_id]
AND r.tags @> array['type','restriction','restriction:bicycle','give_way']
)
WHERE
h1.way && !bbox!
AND h2.way && !bbox!
AND h1.highway IS NOT NULL
AND h2.highway IS NOT NULL
AND h1.osm_id > h2.osm_id
) AS data
geometry: point
properties:
minzoom: 19
- id: waterway_label
<<: *extents
Datasource:
Expand Down
11 changes: 11 additions & 0 deletions symbols/clpc/right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions symbols/clpc/straight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6253be0

Please sign in to comment.