Ticket #20421: josm_20421.patch

File josm_20421.patch, 7.8 KB (added by francois.lacombe, 3 days ago)

This patch finally fixes the rest of this ticket. Update transformer on pole preset, update validation rules

  • resources/data/defaultpresets.xml

     
    66196619            <space />
    66206620            <key key="pipeline" value="substation" />
    66216621            <text key="name" text="Name" />
    6622             <combo key="substation" text="Type" values="compression,distribution,field_gathering,inspection_gauge,measurement,valve,valve_group" values_context="pipeline" values_searchable="true" />
     6622            <combo key="substation" text="Role of substation" values="compression,distribution,field_gathering,inspection_gauge,measurement,valve,valve_group" values_context="pipeline" values_searchable="true" />
    66236623            <reference ref="ref_operator" />
    66246624            <reference ref="substance" />
    66256625        </item> <!-- Pipeline Substation -->
     
    71277127            <space />
    71287128            <key key="power" value="substation" />
    71297129            <text key="name" text="Name" />
    7130             <combo key="substation" text="Type of substation" values="compensation,converter,distribution,industrial,minor_distribution,traction,transition,transmission" values_context="power" />
     7130            <combo key="substation" text="Role of substation" values="compensation,converter,distribution,industrial,minor_distribution,traction,transition,transmission" values_context="power" />
    71317131            <reference ref="power_loc" />
    71327132            <reference ref="voltage_frequency" />
    71337133            <reference ref="ref_operator" />
     
    71417141            <link wiki="Tag:power=transformer" />
    71427142            <space />
    71437143            <key key="power" value="transformer" />
    7144             <combo key="transformer" text="Type of transformer" values="auxiliary,converter,distribution,generator,main,phase_angle_regulator,yes" match="key" values_context="power" />
     7144            <combo key="transformer" text="Nature of transformer" values="auxiliary,converter,distribution,generator,main,phase_angle_regulator,yes" match="key" values_context="power" />
    71457145            <reference ref="power_loc" />
    71467146            <reference ref="transformer_voltage_frequency" />
    71477147            <reference ref="ref_operator" />
     
    72987298            <reference ref="power_pole" />
    72997299            <space />
    73007300            <label text="Transformer Attributes:" />
    7301             <key key="transformer" value="distribution" match="key!" />
     7301            <key key="transformer" value="distribution" match="keyvalue!" />
    73027302            <reference ref="transformer_voltage_frequency" />
    73037303            <reference ref="optional_transformer_rating_phases_devices_windings" />
    73047304        </item> <!-- Pole with Transformer -->
     7305        <item name="Pole with Substation" icon="presets/power/pole_transformer.svg" type="node" preset_name_label="true">
     7306            <link wiki="Tag:power=pole" />
     7307            <space />
     7308            <key key="power" value="pole" />
     7309            <label text="Pole Attributes:" />
     7310            <reference ref="power_pole" />
     7311            <space />
     7312            <label text="Substation Attributes:" />
     7313            <combo key="substation" text="Role of substation" values="industrial,minor_distribution" match="key!" />
     7314            <space />
     7315            <label text="Transformer Attributes:" />
     7316            <combo key="transformer" text="Nature of transformer" values="main" match="none" />
     7317            <reference ref="transformer_voltage_frequency" />
     7318            <reference ref="optional_transformer_rating_phases_devices_windings" />
     7319        </item> <!-- Pole with Substation -->
    73057320        <item name="Catenary mast" icon="presets/power/catenary_mast.svg" type="node" preset_name_label="true">
    73067321            <link wiki="Tag:power=catenary_mast" />
    73077322            <space />
  • resources/data/validator/combinations.mapcss

     
    148148
    149149/* {0.key} without {1.tag} or {2.tag} */
    150150*[bridge:movable               ][bridge!=movable][man_made!=bridge],
    151 *[substation                   ][power!=substation][pipeline!=substation],
    152151*[reservoir_type               ][landuse!=reservoir][water!=reservoir],
    153152way[waterway=pressurised       ][tunnel!=flooded][man_made!=pipeline] {
    154153  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.tag}", "{2.tag}");
     
    155154  group: tr("missing tag");
    156155}
    157156
    158 /* {0.key} without {1.tag}, {2.tag} or {3.tag}, #15107, #20241 */
     157/* {0.key} without {1.tag}, {2.tag} or {3.tag}, #15107, #20241, #20421 */
    159158*[iata                         ][aeroway!=aerodrome][aeroway!=heliport][aeroway!=helipad],
    160 *[icao                         ][aeroway!=aerodrome][aeroway!=heliport][aeroway!=helipad] {
     159*[icao                         ][aeroway!=aerodrome][aeroway!=heliport][aeroway!=helipad],
     160*[substation                   ][power!=substation][power!~/pole|tower/][pipeline!=substation] {
    161161  throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.tag}", "{2.tag}", "{3.tag}");
    162162  group: tr("missing tag");
    163163}
     
    10561057  assertNoMatch: "relation piste:type=nordic piste:grooming=classic";
    10571058}
    10581059
     1060/* #20421 */
     1061*[substation][transformer=distribution] {
     1062  throwWarning: tr("{0} together with {1}", "{1.tag}", "{0.key}");
     1063  suggestAlternative: "transformer=main";
     1064  group: tr("suspicious tag combination");
     1065  fixAdd: "transformer=main"
     1066}
     1067
    10591068/* #21836 */
    10601069*[voltage:primary][voltage:secondary][transformer=generator][tag("voltage:secondary")<tag("voltage:primary")] {
    10611070  throwWarning: tr("{0} is lower than {1} on {2}.", "{1.key}", "{0.key}", "{2.tag}");
  • resources/data/validator/deprecated.mapcss

     
    23322332  fixChangeKey: "service:bicycle:chaintool => service:bicycle:chain_tool";
    23332333}
    23342334
     2335/* #20421 */
     2336*[transformer=minor_distribution] {
     2337  throwWarning: tr("{0} is deprecated", "{1.tag}");
     2338  suggestAlternative: "transformer=distribution";
     2339  group: tr("deprecated tagging");
     2340  fixAdd: "transformer=distribution";
     2341}
     2342
     2343*[transformer=traction] {
     2344  throwWarning: tr("{0} is deprecated", "{0.tag}");
     2345  suggestAlternative: "transformer=main";
     2346  group: tr("deprecated tagging");
     2347  fixAdd: "transformer=main";
     2348}
     2349
     2350*[transformer=auto] {
     2351  throwWarning: tr("{0} is deprecated", "{0.tag}");
     2352  suggestAlternative: "transformer=* + windings:auto=yes";
     2353  group: tr("deprecated tagging");
     2354  fixRemove: "transformer";
     2355  fixAdd: "windings:auto=yes";
     2356}
     2357
    23352358/* #20434 */
    23362359*[building:roof:shape] {
    23372360  throwWarning: tr("{0} is deprecated", "{0.key}");
  • resources/data/validator/geometry.mapcss

     
    429429  throwWarning: tr("Ferry route is not connected to a ferry terminal or branches.");
    430430}
    431431
     432/* 20421 */
     433area[power=substation] ⊇ *[transformer=distribution] {
     434  throwWarning: tr("A distribution transformer shouldn't be contained in a substation.");
     435  suggestAlternative: "transformer=main";
     436  fixAdd: "transformer=main";
     437}
     438
    432439/* #21801 */
    433440way[railway][railway !~ /^(turntable|traverser|platform_edge|roundhouse|workshop|platform)$/] > node[/railway$/ !~ /^(switch|railway_crossing)$/][count(parent_osm_primitives("railway")) > 2]:connection,
    434441way[railway][railway !~ /^(turntable|traverser|platform_edge|roundhouse|workshop|platform)$/] >[index!=1][index!=-1] node[/railway$/ !~ /^(switch|railway_crossing)$/][count(parent_osm_primitives("railway")) == 2]:connection {