Changes between Version 66 and Version 67 of Styles/Lane_and_Road_Attributes


Ignore:
Timestamp:
2023-03-01T22:04:10+01:00 (3 years ago)
Author:
taylor.smock
Comment:

Add support for " and ' in width (not subvalues)

Legend:

Unmodified
Added
Removed
Modified
  • Styles/Lane_and_Road_Attributes

    v66 v67  
    16771677}
    16781678
    1679 
     1679/**
     1680 * Convert width to meters
     1681 */
     1682way[width=~/^(\d+)'$/] {
     1683  road_width: 0.3048 * get(regexp_match("^(\\d+)'$", tag(width)), 1);
     1684}
     1685way[width=~/^(\d+)"$/] {
     1686  road_width: 0.0254 * get(regexp_match("^(\\d+)\"$", tag(width)), 1);
     1687}
     1688way[width=~/^(\d+)'(\d+)"$/] {
     1689  _match: regexp_match("^(\\d+)'(\\d+)\"$", tag(width));
     1690  road_width: 0.3048 * get(prop(_match), 1) + 0.0254 * get(prop(_match), 2);
     1691}
     1692way[width=~/^(\d+)$/] {
     1693  road_width: tag(width);
     1694}
    16801695/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
    16811696/* Determine the width of the lanes, road markings and the inner lane width                                                                        */
     
    16841699{
    16851700    lane_min_width: 4;
    1686     lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
     1701    lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
    16871702    change_allowed: list(6,9);
    16881703    road_marking_width: 1;
     
    16931708{
    16941709    lane_min_width: 8;
    1695     lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
     1710    lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
    16961711    change_allowed: list(12,18);
    16971712    road_marking_width: 2;
     
    17021717{
    17031718    lane_min_width: 8;
    1704     lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
     1719    lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
    17051720    change_allowed: list(24,36);
    17061721    road_marking_width: 2;
     
    17111726{
    17121727    lane_min_width: 8;
    1713     lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
     1728    lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
    17141729    change_allowed: list(48,72);
    17151730    road_marking_width: 2;
     
    17201735{
    17211736    lane_min_width: 12;
    1722     lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
     1737    lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
    17231738    change_allowed: list(96,144);
    17241739    road_marking_width: 4;
     
    17291744{
    17301745    lane_min_width: 20;
    1731     lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
     1746    lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));
    17321747    change_allowed: list(192,288);
    17331748    road_marking_width: 6;