wiki:Rules/FranceSpecificRules

France specific rules

meta {
    title: "France specific rules";
    version: "1.93_2024-03-02";
    description: "Rules, which are limited to France only.";
    author: "PanierAvide";
    icon: "Flag_of_France.svg";
    link: "https://josm.openstreetmap.de/wiki/Rules/FranceSpecificRules";
    min-josm-version: "14481"; /* due to osmose attributs */
    baselanguage: "en";
}
meta[lang=fr] {
    title: "Règles pour la France";
    description: "Règles de validation spécifiques à la France";
}

way[railway=rail][!gauge][inside("FR")] {
    throwWarning: tr("Missing tag gauge on rail");
    suggestAlternative: "gauge";
    -osmoseItemClassLevel: "2160/21600/3";
    -osmoseTags: list("tag", "railway");

    -osmoseAssertMatchWithContext: list("way railway=rail", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way railway=rail gauge=1435", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way railway=disused", "inside=FR");
}

*[name=~/(?i)co.?voiturage/][amenity][amenity!=car_pooling][!carpool][inside("FR")] {
    throwWarning: tr("Missing tag carpool on area");
    -osmoseItemClassLevel: "2080/20806/3";
    -osmoseTags: list("parking", "amenity", "fix:chair");
    fixAdd: "carpool=designated";
    fixAdd: "amenity=car_pooling";
    
    -osmoseAssertMatchWithContext: list("node name='Aire de Covoiturage' amenity=parking", "inside=FR");
    -osmoseAssertMatchWithContext: list("way name='Aire de covoiturage' amenity=car_sharing", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way name='Aire de covoiturage' amenity=car_pooling", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way name='Aire de covoiturage' amenity=parking carpool=designated", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way name='Station Covoiturage' public_transport=platform", "inside=FR");
}

*[amenity=fuel]["fuel:octane_95"=yes][!"fuel:e10"][inside("FR")] {
    throwWarning: tr("Does this station still sell SP95, or has it been replaced by the SP95-E10?");
    -osmoseItemClassLevel: "4061/40612/2";
    -osmoseTags: list("parking", "amenity", "fix:chair");
    suggestAlternative: "fuel:e10=yes/no";
}

/* #12914 - Discourage contributors to use operator=ERDF in France. */
*[operator=ERDF][inside("FR")] {
    throwWarning: tr("{0} is deprecated", "{0.tag}");
    suggestAlternative: "operator=Enedis";
    group: tr("deprecated tagging");
    fixAdd: "operator=Enedis";
    -osmoseItemClassLevel: "4010/40103/3";
    -osmoseTags: list("tag", "infrastructure", "power");
}

/* #18640 - Discourage contributors to use ref:ERDF:gdo in France. */
*["ref:ERDF:gdo"][inside("FR")] {
    throwWarning: tr("{0} is deprecated", "{0.tag}");
    suggestAlternative: "ref:FR:gdo";
    group: tr("deprecated tagging");
    fixChangeKey: "ref:ERDF:gdo=>ref:FR:gdo";
    -osmoseItemClassLevel: "4010/40104/3";
    -osmoseTags: list("ref", "infrastructure", "power");
}

/* #18640 - ref:FR:gdo validation */
*["ref:FR:gdo"]["ref:FR:gdo"!~/[0-9AB]{5}[A-Z]{1,3}[0-9]{4}|[0-9AB]{5}EEM[0-9]{2}/][inside("FR")] {
    throwWarning: tr("{0} is invalid", "{0.tag}");
    -osmoseItemClassLevel: "3040/30406/3";
    -osmoseTags: list("ref", "infrastructure", "power");
}

*[power=substation][!"ref:FR:gdo"][ref][operator=~/^(Enedis|GRDF)$/][inside("FR")],
*[power=switch][!"ref:FR:gdo"][ref][operator=Enedis][inside("FR")] {
    throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
    group: tr("missing tag");
    -osmoseItemClassLevel: "3040/30402/3";
    -osmoseTags: list("ref", "infrastructure", "power");
}

/* #21010 - Ask for power pole/tower operator */
node[power =~ /^(pole|tower)$/][!operator][inside("FR")] {
  throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
  group: tr("missing tag");
}

/* #18552 - Add validation rules for French telecom references */
*["ref:FR:ARCEP"][telecom!=connection_point], 
*["ref:FR:ARCEP"]["telecom:medium"!=fibre],
*["ref:FR:Orange"]["telecom:medium"!=fibre],
*["ref:FR:SFR"]["telecom:medium"!=fibre],
*["ref:FR:PTT"]["telecom:medium"!=copper] {
    throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
    group: tr("missing tag");
    -osmoseItemClassLevel: "3040/30403/3";
    -osmoseTags: list("ref", "infrastructure", "telecom");
}

/* #20607 - Add regexp validation rules for French telecom references */
*["ref:FR:Orange"]["ref:FR:Orange"!~/PT[1-9]{1}[0-9]*/][inside("FR")] {
    throwWarning: tr("{0} is invalid. Should look like PT123 without leading zeros", "{0.tag}");
    -osmoseItemClassLevel: "3040/30407/3";
    -osmoseTags: list("ref", "infrastructure", "telecom");
}
*["ref:FR:Orange:NRO"]["ref:FR:Orange:NRO"!~/[0-9]{5}[A-Z0-9]{3}/][inside("FR")] {
    throwWarning: tr("{0} is invalid. Should look like 12345ABC", "{0.tag}");
    -osmoseItemClassLevel: "3040/30408/3";
    -osmoseTags: list("ref", "infrastructure", "telecom");
}
*["ref:FR:PTT"]["ref:FR:PTT"!~/[A-Z0-9]{3}/][inside("FR")] {
    throwWarning: tr("{0} is invalid. Should look like ABC", "{0.tag}");
    -osmoseItemClassLevel: "3040/30409/3";
    -osmoseTags: list("ref", "infrastructure", "telecom");
}
*["ref:FR:PTT:NRA"]["ref:FR:PTT:NRA"!~/[0-9]{5}[A-Z0-9]{3}/][inside("FR")] {
    throwWarning: tr("{0} is invalid. Should look like 12345ABC", "{0.tag}");
    -osmoseItemClassLevel: "3040/30410/3";
    -osmoseTags: list("ref", "infrastructure", "telecom");
}

/* validation rules for French RIU (Referentiel Inter Urbain) at https://www.data.gouv.fr/fr/datasets/bornage-du-reseau-routier-national   */
node[highway=milestone][operator][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")] {
    throwWarning: tr("{0} is not a milestone valid reference RIU", "{2.tag}");
    group: tr("validation rules highway milestone");
    -osmoseItemClassLevel: "3040/30403/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("node highway=milestone distance=38 nat_ref=77PR38DC operator=SANEF", "inside=FR");
}

/* missing distance for milestone */
node[highway=milestone][operator][nat_ref][!distance][inside("FR")] {
    throwWarning: tr("missing distance");
    group: tr("validation rules highway milestone");
    -osmoseItemClassLevel: "9019/9019001/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertMatchWithContext: list("node highway=milestone nat_ref=77PR38DC operator=SANEF", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("node highway=milestone distance=38 nat_ref=77PR38DC operator=SANEF", "inside=FR");
}

/* tag nat_ref is for links roads, ref is on major roads */
way[highway=~/^(motorway|trunk|primary|secondary|tertiary|unclassified)$/][nat_ref][operator][!junction][inside("FR")],
way[highway=service][nat_ref][nat_ref!~/^([1-9][0-9]|0[1-9])[AN]8[0-9]{3}(|A|N)([0-9]?[0-9])(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][operator][!junction][inside("FR")]
{
    throwWarning: tr("{0} must be a link road or roundabout", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertMatchWithContext: list("way highway=primary nat_ref=62A901609CD_2D operator=SANEF", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=service nat_ref=50A802209_1D operator=DIRO", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=primary junction=roundabout nat_ref=62A901609CD_2D operator=SANEF", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=service junction=roundabout nat_ref=62A801609CD_12D operator=SANEF", "inside=FR");
}

way[highway=~/^(motorway|trunk|primary|secondary|tertiary|unclassified|service)$/]["nat_ref:backward"][operator][inside("FR")],
way[highway=~/^(motorway|trunk|primary|secondary|tertiary|unclassified|service)$/]["nat_ref:forward"][operator][inside("FR")] {
    throwWarning: tr("{0} must be a link road ", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref:forward=62A902615CD_11D nat_ref:backward=62A902615CD_2D operator='SANEF'", "inside=FR");
}

/* tag nat_ref is well formed (isidor format) , (bretelles code 9 ou aire de service code 8)*/
way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/][nat_ref][nat_ref!~/^([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][operator!="VILLE DE PARIS"][inside("FR")]{
    throwWarning: tr("{0} is not a valid reference", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref=80A901645CD_16D operator=SANEF", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref=80A801645CD_16D operator=SANEF", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref=78A901319CD_1D operator=SAPN", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref=78A801319CD_1D operator=SAPN", "inside=FR");
}

/* tag nat_ref is well formed on roundabout (isidor format) */
way[junction=roundabout][highway=~/^(motorway|trunk|primary|secondary|tertiary|unclassified|service)$/][nat_ref][nat_ref!~/^(([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$/][inside("FR")] {
    throwWarning: tr("{0} is not a valid reference", "{2.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=primary junction=roundabout nat_ref=80A901645_16D operator=DIRN", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=service junction=roundabout nat_ref=80A801645_6D operator=DIRN", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=primary junction=roundabout nat_ref=78A901319CD_15D operator=DIRN", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=service junction=roundabout nat_ref=78A801319CD_1D operator=DIRN", "inside=FR");
}

/* tag nat_ref is well formed specific Paris (isidor format). no roundabout in Paris*/
way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/][nat_ref][nat_ref!~/^(75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])D)$/][operator="VILLE DE PARIS"][inside("FR")] {
    throwWarning: tr("{0} is not a valid reference (Paris)", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=trunk_link nat_ref=75Periph_Paris_05_3D operator=\"VILLE DE PARIS\"", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=primary_link nat_ref=75Periph_Paris_05_13D operator=\"VILLE DE PARIS\"", "inside=FR");
}

/* tag nat_ref is well formed for backward and forward (isidor format). No roundabout */
way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:forward"]["nat_ref:forward"!~/^(([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$/][inside("FR")],
way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:backward"]["nat_ref:backward"!~/^(([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$/][inside("FR")]{
    throwWarning: tr("{0} is not a valid reference", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref:forward=62A902615CD_1D nat_ref:backward=62A902615CD_2D operator=SANEF", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref:forward=62A902615CD_11D nat_ref:backward=62A902615CD_2D operator=SANEF", "inside=FR");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref:forward=62A902615CD_1D nat_ref:backward=62A902615CD_12D operator=SANEF", "inside=FR");
}

/* nat_ref reference without operator */
way[highway][highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/][nat_ref][!operator][inside("FR")] {
    throwWarning: tr("Missing tag operator with nat_ref");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
}

way[highway][highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:forward"][!operator][inside("FR")],
way[highway][highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:backward"][!operator][inside("FR")] {
    throwWarning: tr("Missing tag operator with nat_ref");
    group: tr("validation rules nat_ref in France");
    -osmoseItemClassLevel: "9019/9019002/3";
    -osmoseTags: list("ref", "highway");
}

/* #10391, #19570 - Many misuses of building=hangar instead of building=barn/industrial/warehouse */
area:closed2[aeroway]  way[building=hangar][!aeroway][inside("FR")] {
  throwWarning: tr("{0} outside of {1}", "{0.tag}", "aeroway");
  suggestAlternative: "building=barn";
  suggestAlternative: "building=industrial";
  suggestAlternative: "building=warehouse";
}

node[highway=motorway_junction][ref=~/^\D/][inside("FR")] {
    throwWarning: "Unusual ref for motorway_junction; use of 'ref=*' for the exit destination ref?";
    fixRemove: "ref";
    suggestAlternative: "'destination:ref=*' tag on the exiting 'highway=*_link'";
    -osmoseAssertMatchWithContext: list("node highway=motorway_junction ref=N7", "inside=FR");
}

*[amenity=kindergarten]["school:FR"=maternelle][inside("FR")] {
    throwWarning: "amenity=kindergarten is no longer used for an 'école maternelle' in France, use amenity=school";
    fixAdd: "amenity=school";
    suggestAlternative: "amenity=school";
    group: tr("misused tag in this country");
    -osmoseItemClassLevel: "4010/40105/3";
}

/* validation du code ref:FR:FANTOIR
la description est dans cette page du wiki https://wiki.openstreetmap.org/wiki/FR:Key:ref:FR:FANTOIR
pour le code insee : ((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7])))
pour le code fantoir : ([0-9]|[A-Z])([0-9]{3})([ABCDEFGHJKLMNPRSTUVWXYZ|])
le dernier caractère (lettre) est optionnel car n'apparait plus dans les données officielles cela peut etre répété plusieurs fois délimités par un ';' 
le code fantoir peut aussi prendre la valeur "no"*/

*["ref:FR:FANTOIR"]["ref:FR:FANTOIR"!~/^(((((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|))(|;(((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|)))+)|no)$/][inside("FR")],
*["ref:FR:FANTOIR:left"]["ref:FR:FANTOIR:left"!~/^(((((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|))(|;(((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|)))+)|no)$/][inside("FR")],
*["ref:FR:FANTOIR:right"]["ref:FR:FANTOIR:right"!~/^(((((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|))(|;(((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|)))+)|no)$/][inside("FR")] {
   throwWarning: "format code ref:FR:FANTOIR";
   group: tr("validation rules Fantoir in France");
   -osmoseItemClassLevel: "9019/9019005/3";
   -osmoseTags: list("ref", "highway");
   -osmoseAssertNoMatchWithContext: list("way highway=residential name=impasse ref:FR:FANTOIR=75106S581T;67317B012Y", "inside=FR");
   -osmoseAssertNoMatchWithContext: list("way highway=residential name=impasse ref:FR:FANTOIR=751064581T", "inside=FR");
   -osmoseAssertNoMatchWithContext: list("way highway=residential name=impasse ref:FR:FANTOIR=751064581", "inside=FR");
   -osmoseAssertNoMatchWithContext: list("way highway=residential name=impasse ref:FR:FANTOIR=95106A581T", "inside=FR");
   -osmoseAssertNoMatchWithContext: list("way highway=residential name=impasse ref:FR:FANTOIR=95106A581", "inside=FR");
   -osmoseAssertNoMatchWithContext: list("way highway=residential name=impasse ref:FR:FANTOIR:left=75106S581L ref:FR:FANTOIR:right=75106S581R", "inside=FR");
   -osmoseAssertNoMatchWithContext: list("way highway=residential name=impasse ref:FR:FANTOIR:left=no ref:FR:FANTOIR:right=75106S581;67317B012Y;751064581", "inside=FR");
}

Rules_FranceSpecificRules.validator.mapcss, Rules_FranceSpecificRules.zip

Last modified 2 months ago Last modified on 2024-03-02T09:17:02+01:00

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.