| | 87 | |
| | 88 | /* #xxxxx add validation rules for French RIU (Referentiel Inter Urbain) at https://www.data.gouv.fr/fr/datasets/bornage-du-reseau-routier-national/* |
| | 89 | /* # nat_ref is well formed on node (milestone) */ |
| | 90 | node[highway=milestone][nat_ref][nat_ref!~/([1-9][0-9]|0[1-9])PR([0-9]|[1-9][0-9]|[1-9][0-9][0-9])[DGU](|C)/][inside("FR")] { |
| | 91 | throwWarning: tr("{1} is not a valid reference RIU", "{1.tag}"); |
| | 92 | -osmoseAssertMatchWithContext: list("node highway=milestone ref='A 4' nat_ref='77PR38DC' operator='SANEF'","inside=FR"); |
| | 93 | } |
| | 94 | /* # Select major roads */ |
| | 95 | way[highway=~/^(motorway|trunk|primary|secondary|tertiary)$/] { |
| | 96 | set major_road; |
| | 97 | } |
| | 98 | /* # Select links roads */ |
| | 99 | way[highway=~/^.*_link$/] { |
| | 100 | set link_road; |
| | 101 | } |
| | 102 | /* # tag nat_ref is for links roads, ref is on major roads */ |
| | 103 | way.major_road[nat_ref][operator][inside("FR")] { |
| | 104 | throwWarning: tr("{1} must be a link road", "{1.tag}"); |
| | 105 | -osmoseAssertMatchWithContext: list("way highway=primary_link nat_ref='62A901609CD_2' operator='SANEF'", "inside=FR"); |
| | 106 | -osmoseAssertNoMatchWithContext: list("way highway=primary nat_ref='62A901609CD_2' operator='SANEF'", "inside=FR"); |
| | 107 | } |
| | 108 | way.major_road[nat_ref:backward][operator][inside("FR")] { |
| | 109 | throwWarning: tr("{1} must be a link road", "{1.tag}"); |
| | 110 | -osmoseAssertMatchWithContext: list("way highway=motorway_link nat_ref:forward='62A902615CD_1' nat_ref:backward='62A902615CD_2' operator='SANEF'", "inside=FR"); |
| | 111 | -osmoseAssertNoMatchWithContext: list("way highway=motorway nat_ref:forward='62A902615CD_1' nat_ref:backward='62A902615CD_2' operator='SANEF'", "inside=FR"); |
| | 112 | } |
| | 113 | way.major_road[nat_ref:forward][operator][inside("FR")] { |
| | 114 | throwWarning: tr("{1} must be a link road", "{1.tag}"); |
| | 115 | } |
| | 116 | /* # tag nat_ref is well formed */ |
| | 117 | way.link_road[nat_ref][operator!="VILLE DE PARIS"][nat_ref!~/([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}[0-9]{2}[a-z]*(|CD)_(1[0-9]|[1-9])/][inside("FR")] { |
| | 118 | throwWarning: tr("{1} is not a valid reference", "{1.tag}"); |
| | 119 | -osmoseAssertMatchWithContext: list("way highway=motorway_link nat_ref='94A900402_1' operator='DIRIF'", "inside=FR"); |
| | 120 | -osmoseAssertMatchWithContext: list("way highway=motorway_link nat_ref='80A901645CD_6' operator='SANEF'", "inside=FR"); |
| | 121 | -osmoseAssertNoMatchWithContext: list("way highway=primary nat_ref='62A901609CD_2' operator='SANEF'", "inside=FR"); |
| | 122 | } |
| | 123 | /* # tag nat_ref is well formed specific Paris*/ |
| | 124 | way.link_road[nat_ref][operator="VILLE DE PARIS"][nat_ref!~/75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])/][inside("FR")] { |
| | 125 | throwWarning: tr("{1} is not a valid reference (Paris)", "{1.tag}"); |
| | 126 | -osmoseAssertMatchWithContext: list("way highway=trunk_link nat_ref='75Periph_Paris_05_3' operator='VILLE DE PARIS'", "inside=FR"); |
| | 127 | } |
| | 128 | |
| | 129 | way.link_road[nat_ref:forward][nat_ref:forward!~/([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}[0-9]{2}[a-z]*(|CD)_(1[0-9]|[1-9])/][inside("FR")][one_way!=yes] { |
| | 130 | throwWarning: tr("{1} is not a valid reference", "{1.tag}"); |
| | 131 | -osmoseAssertMatchWithContext: list("way highway=motorway_link nat_ref:forward='62A902615CD_1' nat_ref:backward='62A902615CD_2' operator=SANEF", "inside=FR"); |
| | 132 | -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref:forward='62A902615CD_1' one_way='yes' operator='SANEF'", "inside=FR"); |
| | 133 | -osmoseAssertNoMatchWithContext: list("way highway=motorway nat_ref:forward='62A902615CD_1' one_way='no' operator='SANEF'", "inside=FR"); |
| | 134 | } |
| | 135 | way.link_road[nat_ref:backward][nat_ref:backward!~/([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}[0-9]{2}[a-z]*(|CD)_(1[0-9]|[1-9])/][inside("FR")][one_way!=yes] { |
| | 136 | throwWarning: tr("{1} is not a valid reference", "{1.tag}"); |
| | 137 | } |
| | 138 | /* # nat_ref reference without operator */ |
| | 139 | way[highway][nat_ref][!operator][inside("FR")] { |
| | 140 | throwWarning: tr("Missing tag operator with nat_ref"); |
| | 141 | } |
| | 142 | way[highway][nat_ref:forward][!operator][inside("FR")] { |
| | 143 | throwWarning: tr("Missing tag operator with nat_ref"); |
| | 144 | } |
| | 145 | way[highway][nat_ref:backward][!operator][inside("FR")] { |
| | 146 | throwWarning: tr("Missing tag operator with nat_ref"); |
| | 147 | } |
| | 148 | |