wiki:Rules/FranceSpecificRules

Version 31 (modified by didier2020, 5 years ago) ( diff )

le n° echangeur est codé sur 1 ou 2 chiffres

France specific rules

meta {
    title: "France specific rules";
    version: "1.106_2025-06-21";
    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!=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");
}

*[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");
}

/* #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");
}

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

*[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");
}

/* #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");
}

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

/* missing ref for milestone */
node[highway=milestone][!ref][inside("FR")] {
    throwWarning: tr("missing ref");
    group: tr("validation rules highway milestone");
    -osmoseTags: list("ref", "highway");
}

/* missing distance for milestone */
node[highway=milestone][!distance][inside("FR")] {
    throwWarning: tr("missing distance");
    group: tr("validation rules highway milestone");
    -osmoseTags: list("ref", "highway");
}

/* Select major roads */
way[highway=~/^(motorway|trunk|primary|secondary|tertiary)$/] {
  set major_road;
}

/* Select links roads */
way[highway=~/^.*_link$/] {
  set link_road;
}

/* tag nat_ref is for links roads, ref is on major roads */
way.major_road[nat_ref][operator][inside("FR")] {
    throwWarning: tr("{0} must be a link road", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=primary_link nat_ref=62A901609CD_2 operator=SANEF", "inside=FR");
}

way.major_road[nat_ref:backward][operator][inside("FR")] {
    throwWarning: tr("{0} must be a link road ", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref:forward=62A902615CD_1 nat_ref:backward=62A902615CD_2 operator='SANEF'", "inside=FR");
}

way.major_road[nat_ref:forward][operator][inside("FR")] {
    throwWarning: tr("{0} must be a link road", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
}

/* tag nat_ref is well formed */
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][0-9]*[a-z]*(|CD)_(1[0-9]|[1-9])$/][inside("FR")] {
    throwWarning: tr("{0} is not a valid reference", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref=80A901645CD_6 operator=SANEF", "inside=FR");
}

/* tag nat_ref is well formed specific Paris*/
way.link_road[nat_ref][operator="VILLE DE PARIS"][nat_ref!~/75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])$/][inside("FR")] {
    throwWarning: tr("{0} is not a valid reference (Paris)", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=trunk_link nat_ref=75Periph_Paris_05_3 operator=\"VILLE DE PARIS\"", "inside=FR");
}

way.link_road[nat_ref:forward][nat_ref:forward!~/([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}[0-9][0-9]*[a-z]*(|CD)_(1[0-9]|[1-9])$/][inside("FR")] {
    throwWarning: tr("{0} is not a valid reference", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
    -osmoseAssertNoMatchWithContext: list("way highway=motorway_link nat_ref:forward=62A902615CD_1 nat_ref:backward=62A902615CD_2 operator=SANEF", "inside=FR");
}

way.link_road[nat_ref:backward][nat_ref:backward!~/([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}[0-9][0-9]*[a-z]*(|CD)_(1[0-9]|[1-9])$/][inside("FR")] {
    throwWarning: tr("{0} is not a valid reference", "{1.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
}

/* nat_ref reference without operator */
way[highway][nat_ref][!operator][inside("FR")] {
    throwWarning: tr("Missing tag operator with nat_ref");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
}

way[highway][nat_ref:forward][!operator][inside("FR")] {
    throwWarning: tr("Missing tag operator with nat_ref");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
}

way[highway][nat_ref:backward][!operator][inside("FR")] {
    throwWarning: tr("Missing tag operator with nat_ref");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
}

way.link_road[nat_ref:forward][oneway=~/^(yes|1|-1)$/][inside("FR")] {
    throwWarning: tr("{0} no tag forward if oneway", "{2.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
}

way.link_road[nat_ref:backward][oneway=~/^(yes|1|-1)$/][inside("FR")] {
    throwWarning: tr("{0} no tag backward if oneway", "{2.tag}");
    group: tr("validation rules nat_ref in France");
    -osmoseTags: list("ref", "highway");
}

Rules_FranceSpecificRules.validator.mapcss, Rules_FranceSpecificRules.zip

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.