Hungary specific rules
meta { title: "Hungary specific rules"; version: "9_2026-10-23"; description: "Rules, which are limited to Hungary only."; author: "gaben"; link: "https://josm.openstreetmap.de/wiki/Rules/HungarySpecific"; icon: "Flag_of_Hungary.svg"; min-josm-version: "11424"; /* due to territory selectors */ baselanguage: "hu"; } meta[lang=hu] { title: "Magyarországon használatos szabályok"; description: "Magyarországi térképszerkesztéshez használható kiegészítő szabályok, amik a főprogramban elérhető szabályok kiegészítésére szolgálnak"; } /* Note: (?i) is ASCII-only in Java, (?iu) is needed for accented letters (á, é, ő, ű, ...) */ *[inside("HU")] { set itthon; } /* street names */ way[highway=~/^(trunk|primary|secondary|tertiary|unclassified|residential|living_street|service|pedestrian)(_link)?$/][name=~/(?<!\p{L})u\./].itthon { group: "[HU] specifikus szabályok"; throwWarning: "gyanús utca rövidítés, használd a teljes \"utca\" megnevezést"; fixAdd: concat("name=", replace(tag("name"), "u.", "utca")); assertMatch: "way highway=residential name=\"Fő u.\""; assertMatch: "way highway=primary_link name=\"Kossuth Lajos u.\""; assertNoMatch: "way highway=residential name=\"Fő utca\""; assertNoMatch: "way highway=footway name=\"Fő u.\""; assertNoMatch: "way highway=residential name=\"Bartóku.\""; } *[addr:street=~/(?<!\p{L})u\./].itthon { group: "[HU] specifikus szabályok"; throwWarning: "gyanús utca rövidítés a címben, használd a teljes \"utca\" megnevezést"; fixAdd: concat("addr:street=", replace(tag("addr:street"), "u.", "utca")); assertMatch: "node addr:street=\"Fő u.\""; assertNoMatch: "node addr:street=\"Fő utca\""; } way[highway][name=~/(?<!\p{L})(krt|rkp|ltp|stny)\./].itthon, *[addr:street=~/(?<!\p{L})(krt|rkp|ltp|stny)\./].itthon { group: "[HU] specifikus szabályok"; throwWarning: "gyanús rövidítés az utcanévben (krt., rkp., ltp., stny.), írd ki teljesen"; assertMatch: "way highway=primary name=\"Szent István krt.\""; assertMatch: "node addr:street=\"Pesti alsó rkp.\""; assertNoMatch: "way highway=primary name=\"Szent István körút\""; } way[highway][name=~/ (Utca|Út|Útja|Tér|Tere|Köz|Körút|Sor|Sétány|Rakpart|Fasor|Lakótelep)$/].itthon, *[addr:street=~/ (Utca|Út|Útja|Tér|Tere|Köz|Körút|Sor|Sétány|Rakpart|Fasor|Lakótelep)$/].itthon { group: "[HU] specifikus szabályok"; throwWarning: "a közterület jellegét kisbetűvel írjuk (pl. utca, út, tér)"; assertMatch: "way highway=residential name=\"Fő Utca\""; assertMatch: "node addr:street=\"Kossuth Lajos Út\""; assertNoMatch: "way highway=residential name=\"Fő utca\""; assertNoMatch: "node addr:street=\"Hősök tere\""; } /* living street */ way[highway=living_street][access][motor_vehicle].itthon, way[highway=living_street][access][!motor_vehicle].itthon, way[highway=living_street][!access][motor_vehicle].itthon { group: "[HU] specifikus szabályok"; throwError: "lakó-pihenő övezetben a behajtási korlátozás csak járművekre vonatkozik (kivéve kerékpár)!"; suggestAlternative: "vehicle=destination + bicycle=yes"; fixAdd: "bicycle=yes"; fixAdd: "vehicle=destination"; fixRemove: "access"; fixRemove: "motor_vehicle"; } /* way[highway=living_street][!access][!motor_vehicle][vehicle!=destination][bicycle!=yes].itthon, way[highway=living_street][!access][!motor_vehicle][vehicle=destination][bicycle!=yes].itthon, way[highway=living_street][!access][!motor_vehicle][vehicle!=destination][bicycle=yes].itthon { group: "[HU] specifikus szabályok"; throwWarning: "lakó-pihenő övezetben expliciten add meg a járművek behajtási korlátozását"; suggestAlternative: "vehicle=destination + bicycle=yes"; fixAdd: "vehicle=destination"; fixAdd: "bicycle=yes"; } */ way[highway=living_street][!maxspeed].itthon { group: "[HU] specifikus szabályok"; throwWarning: "lakó-pihenő övezetben add meg a jogszabályi maximális sebességet (20 km/h)"; fixAdd: "maxspeed=20"; fixAdd: "source:maxspeed=HU:living_street"; assertMatch: "way highway=living_street"; assertNoMatch: "way highway=living_street maxspeed=20"; } way[highway=living_street][maxspeed][maxspeed!=20][source:maxspeed!="HU:living_street"][maxspeed:type!="HU:living_street"].itthon { group: "[HU] specifikus szabályok"; throwWarning: "lakó-pihenő övezetben a maximális sebesség 20 km/h"; fixAdd: "maxspeed=20"; assertMatch: "way highway=living_street maxspeed=30"; assertNoMatch: "way highway=living_street maxspeed=20"; } /* maxspeed */ *[source:maxspeed="HU:urban"][maxspeed][maxspeed!=50].itthon, *[source:maxspeed:forward="HU:urban"][maxspeed:forward][maxspeed:forward!=50].itthon, *[source:maxspeed:backward="HU:urban"][maxspeed:backward][maxspeed:backward!=50].itthon, *[source:maxspeed="HU:rural"][maxspeed][maxspeed!=90].itthon, *[source:maxspeed:forward="HU:rural"][maxspeed:forward][maxspeed:forward!=90].itthon, *[source:maxspeed:backward="HU:rural"][maxspeed:backward][maxspeed:backward!=90].itthon, *[source:maxspeed="HU:trunk"][maxspeed][maxspeed!=110].itthon, *[source:maxspeed:forward="HU:trunk"][maxspeed:forward][maxspeed:forward!=110].itthon, *[source:maxspeed:backward="HU:trunk"][maxspeed:backward][maxspeed:backward!=110].itthon, *[source:maxspeed="HU:motorway"][maxspeed][maxspeed!=130].itthon, *[source:maxspeed:forward="HU:motorway"][maxspeed:forward][maxspeed:forward!=130].itthon, *[source:maxspeed:backward="HU:motorway"][maxspeed:backward][maxspeed:backward!=130].itthon, *[source:maxspeed="HU:living_street"][maxspeed][maxspeed!=20].itthon, *[maxspeed:type="HU:urban"][!source:maxspeed][maxspeed][maxspeed!=50].itthon, *[maxspeed:type="HU:rural"][!source:maxspeed][maxspeed][maxspeed!=90].itthon, *[maxspeed:type="HU:trunk"][!source:maxspeed][maxspeed][maxspeed!=110].itthon, *[maxspeed:type="HU:motorway"][!source:maxspeed][maxspeed][maxspeed!=130].itthon, *[maxspeed:type="HU:living_street"][!source:maxspeed][maxspeed][maxspeed!=20].itthon { group: "[HU] specifikus szabályok"; throwWarning: "a maximálisan megengedett sebesség és a sebességforrás nem egyezik"; assertMatch: "way highway=primary source:maxspeed=HU:urban maxspeed=60"; assertMatch: "way highway=primary maxspeed:type=HU:rural maxspeed=50"; assertMatch: "way highway=primary source:maxspeed:forward=HU:urban maxspeed:forward=70"; assertNoMatch: "way highway=primary source:maxspeed=HU:urban maxspeed=50"; assertNoMatch: "way highway=primary source:maxspeed=HU:urban"; } *[maxspeed:type][source:maxspeed].itthon { group: "[HU] specifikus szabályok"; throwWarning: "{0.key} és {1.key} ugyanazon az objektumon, távolítsd el az egyiket"; assertMatch: "way maxspeed:type=HU:urban source:maxspeed=HU:urban"; assertNoMatch: "way source:maxspeed=HU:urban"; } /* names suggesting missing or wrong tags */ *[name=~/(?iu)tüzép|t[üű]zifa/][shop!=trade][!highway][!railway].itthon { group: "[HU] specifikus szabályok"; throwWarning: "tüzéptelepekre használd a shop=trade címkézést"; fixAdd: "shop=trade"; assertMatch: "node name=TÜZÉP"; assertMatch: "node name=\"Tűzifa kereskedés\""; assertNoMatch: "node name=Tüzép shop=trade"; } *[building][name=~/(?iu)kastély/][historic][historic!=castle].itthon { group: "[HU] specifikus szabályok"; throwWarning: "történelmi kastélyokra használd a historic=castle + castle_type=* címkézést"; fixAdd: "historic=castle"; assertMatch: "way building=yes historic=manor name=\"Esterházy-KASTÉLY\""; assertNoMatch: "way building=yes historic=castle name=Esterházy-kastély"; } *[shop=clothes][name=~/(?iu)használt/][!second_hand].itthon { group: "[HU] specifikus szabályok"; throwWarning: "használt ruhás bolthoz használd a second_hand=yes címkézést"; fixAdd: "second_hand=yes"; assertMatch: "node shop=clothes name=\"HASZNÁLT RUHA\""; assertNoMatch: "node shop=clothes second_hand=yes name=\"Használt ruha\""; } *[landuse=cemetery][name=~/(?iu)zsidó/][religion!=jewish].itthon { group: "[HU] specifikus szabályok"; throwWarning: "zsidó temetőhöz használd a religion=jewish címkézést"; fixAdd: "religion=jewish"; assertMatch: "way landuse=cemetery name=\"Zsidó temető\""; assertNoMatch: "way landuse=cemetery religion=jewish name=\"Zsidó temető\""; } *[historic=memorial][name=~/(?iu)háború|hősi emlékmű/][memorial!=war_memorial].itthon { group: "[HU] specifikus szabályok"; throwWarning: "háborús emlékműhöz használd a memorial=war_memorial címkézést"; fixAdd: "memorial=war_memorial"; assertMatch: "node historic=memorial name=\"Hősi emlékmű\""; assertMatch: "node historic=memorial name=\"I. VILÁGHÁBORÚS emlékmű\""; assertNoMatch: "node historic=memorial memorial=war_memorial name=\"Hősi emlékmű\""; } *[memorial=war_memorial][!memorial:conflict][name=~/(?iu)(?<!I)I\.\s*(és|,)\s*(a\s+)?II\.|első\s+és\s+(a\s+)?második/].itthon { group: "[HU] specifikus szabályok"; throwWarning: "I. és II. világháborús emlékműhöz használd a memorial:conflict=WW1;WW2 címkézést"; fixAdd: "memorial:conflict=WW1;WW2"; assertMatch: "node memorial=war_memorial name=\"I. és II. világháborús emlékmű\""; assertMatch: "node memorial=war_memorial name=\"Első és második világháborús emlékmű\""; assertNoMatch: "node memorial=war_memorial name=\"I. világháborús emlékmű\""; assertNoMatch: "node memorial=war_memorial name=\"II. világháborús emlékmű\""; } *[memorial=war_memorial][!memorial:conflict][name=~/(?iu)(?<!I)I\. világ|első világ/].itthon { group: "[HU] specifikus szabályok"; throwWarning: "I. világháborús emlékműhöz használd a memorial:conflict=WW1 címkézést"; fixAdd: "memorial:conflict=WW1"; assertMatch: "node memorial=war_memorial name=\"I. világháborús emlékmű\""; assertMatch: "node memorial=war_memorial name=\"Első világháborús emlékmű\""; assertNoMatch: "node memorial=war_memorial name=\"II. világháborús emlékmű\""; assertNoMatch: "node memorial=war_memorial name=\"I. és II. világháborús emlékmű\""; } *[memorial=war_memorial][!memorial:conflict][name=~/(?iu)II\. világ|második világ/][name!~/(?iu)(?<!I)I\.\s*(és|,)\s*(a\s+)?II\.|első\s+és\s+(a\s+)?második/].itthon { group: "[HU] specifikus szabályok"; throwWarning: "II. világháborús emlékműhöz használd a memorial:conflict=WW2 címkézést"; fixAdd: "memorial:conflict=WW2"; assertMatch: "node memorial=war_memorial name=\"II. világháborús emlékmű\""; assertMatch: "node memorial=war_memorial name=\"Második világháborús emlékmű\""; assertNoMatch: "node memorial=war_memorial name=\"I. világháborús emlékmű\""; assertNoMatch: "node memorial=war_memorial name=\"I. és II. világháborús emlékmű\""; } area[landuse=quarry][name=~/(?iu)szén/][!resource].itthon { group: "[HU] specifikus szabályok"; throwWarning: "add meg a bányából kinyert nyersanyagot: szén"; fixAdd: "resource=coal"; } area[landuse=quarry][name=~/(?iu)kavics/][!resource].itthon { group: "[HU] specifikus szabályok"; throwWarning: "add meg a bányából kinyert nyersanyagot: kavics"; fixAdd: "resource=aggregate"; } area[landuse=quarry][name=~/(?iu)homok/][!resource].itthon { group: "[HU] specifikus szabályok"; throwWarning: "add meg a bányából kinyert nyersanyagot: homok"; fixAdd: "resource=sand"; } area[landuse=quarry][name=~/(?iu)agyag/][!resource].itthon { group: "[HU] specifikus szabályok"; throwWarning: "add meg a bányából kinyert nyersanyagot: agyag"; fixAdd: "resource=clay"; } area[landuse=quarry][name=~/(?iu)mészkő/][!resource].itthon { group: "[HU] specifikus szabályok"; throwWarning: "add meg a bányából kinyert nyersanyagot: mészkő"; fixAdd: "resource=limestone"; } *[name=~/(?iu)statisztikai hivatal/][office=government][government!=statistics].itthon { group: "[HU] specifikus szabályok"; throwWarning: "add meg a KSH irodához tartozó címkét"; fixAdd: "government=statistics"; assertMatch: "node office=government name=\"Központi Statisztikai Hivatal\""; assertNoMatch: "node office=government government=statistics name=\"Központi Statisztikai Hivatal\""; } *[name=~/(?iu)államkincstár/][office=government][government!=treasury].itthon { group: "[HU] specifikus szabályok"; throwWarning: "add meg az államkincstárhoz irodához tartozó címkét"; fixAdd: "government=treasury"; assertMatch: "node office=government name=\"Magyar ÁLLAMKINCSTÁR\""; assertNoMatch: "node office=government government=treasury name=\"Magyar Államkincstár\""; } /* [amenity!=x] also matches when amenity is missing */ *[name=~/(?iu)faluház/][!highway][amenity!=community_centre].itthon { group: "[HU] specifikus szabályok"; throwWarning: "faluházhoz használd az amenity=community_centre címkét"; fixAdd: "amenity=community_centre"; assertMatch: "node name=Faluház"; assertMatch: "node name=FALUHÁZ amenity=townhall"; assertNoMatch: "node name=Faluház amenity=community_centre"; assertNoMatch: "way name=\"Faluház utca\" highway=residential"; } *[name=~/(?iu)községháza/][!highway][!route][amenity!=townhall].itthon { group: "[HU] specifikus szabályok"; throwWarning: "községházához használd az amenity=townhall címkét"; fixAdd: "amenity=townhall"; assertMatch: "node name=Községháza"; assertNoMatch: "node name=Községháza amenity=townhall"; } /* addresses as of 2026-10-13 */ /* Use grex (https://github.com/pemistahl/grex) and the XLSX sheet from https://net.posta.hu/dashboard/public/dashboard-ui/iranyitoszam-kereso/download-as-table to update */ /* It validates the postcode against all official numbers */ *[addr:postcode][addr:postcode!~/^(?:1(?:007|23[7-9])|2(?:0(?:1[13-7]|8[013-69])|(?:06|17)[03-7]|3(?:4[0457]|6[03-7])|51[07-9])|269[1-46-9]|3(?:07[03-578]|10[0249]|24[0235-8]|5(?:0[018]|1[5-9]|2[14-9]|3[0-5])|60[048]|7(?:2[0-689]|8[0367])|8(?:2[156]|3[1-467]|4[1-46-9]|6[03-6])|98[057-9])|4(?:0(?:2[4-9]|3[0-4]|6[03-79]|7[14589])|13[02-8]|26[2-467]|32[04-7]|44[015-7]|51[15-7]|80[034])|(?:2(?:24|72)|418)[134]|400[02]|474[1-356]|223[03-5]|5(?:24[134]|47[14-6]|5(?:0[02]|3[046-9]|5[1-356])|73[124]|9(?:0[03-5]|4[0568]))|583[06-8]|237[0135-8]|(?:2(?:22|75)|440|5(?:43|92))[05]|(?:2(?:31|76)|3(?:39|95)|411)[04-9]|462[1-578]|(?:308|404|5(?:15|22))2|6(?:0(?:6[024-7]|9[06-8])|32[0135-8]|05[05]|4(?:3[05]|4[04-9])|52[1-578]|612)|(?:290|6[59]0)[03]|(?:274|40[89]|5(?:13|52|72))[05-7]|422[045]|(?:247|362)[1-35-7]|675[03-8]|(?:396|473)[1-57]|7(?:0(?:0[03]|2[05-7]|9[0-57-9])|13[0-6]|2(?:2[4-8]|7[1-69])|3(?:0[045]|9[1346])|43[124-69]|5(?:5[1-35-7]|8[24-9])|6(?:3[0-69]|6[13468]|7[1-3578])|7(?:2[03-8]|3[1-357]|6[1-368])|[07]4[1-57]|8(?:1[1-57]|2[2-7]|3[1346-9]|4[13679]|5[0134])|9(?:1[2-58]|3[24-7]|5[13478]|6[046-8]|7[1-35-79]|8[01578]))|5919|(?:363|445|551|6(?:63|80))[056]|204[059]|(?:233|317|623)[05-9]|[56]00[08]|(?:3(?:25|90)|676|714)[02-9]|(?:388|771)[124-8]|(?:2(?:45|62)|3(?:12|34))[13-9]|(?:273|391|6(?:0[78]|64))[05-8]|(?:289|358)[06-9]|(?:2(?:48|54)|746)[13-5]|377[035-9]|775[1-79]|3(?:41|97)[1-46-8]|753[0235-9]|447[1245]|(?:268|725)[1-35-8]|370[04]|475[124-6]|8(?:0(?:19|6[056]|8[0-35-9]|9[235-7])|1(?:0[059]|4[2-6])|2(?:2[05-9]|3[037]|9[124-7])|3(?:0[08]|4[124-9])|4(?:2[02-9]|3[0-589]|5[124-8]|7[13-9])|26[13-5]|6(?:1[2-47-9]|3[05-8]|[46][06-9]|8[13-5])|7(?:0[035-9]|4[1-79]|7[1-46-8]|8[24589]|9[0235-9])|76[12457]|17[1245]|8(?:2[12457]|3[1245]|7[2-46-9]|8[1-35-8]|9[135-7])|9(?:0[04]|3[124-6]|4[3-9]|5[1346-8]|6[069]|7[135-8]|[28][13-689]|9[0-24-9]))|285[1-689]|(?:3(?:37|76)|891)[1-57-9]|(?:118|8(?:65|72|86))[1-68]|4(?:28|46)[13-8]|(?:2(?:15|3[58]|9[1-3])|322|4[36]1|5(?:07|11|33|56|81)|6(?:[23]1|82)|726|832)1|(?:2(?:03|50|66)|3(?:36|45)|535|7(?:03|15)|8(?:46|80))[089]|(?:205|564)[13]|240[07]|306[03-9]|(?:2(?:09|6[14])|335|672|8(?:13|44|71))[0-9]|(?:70|81)5[12467]|(?:482|8(?:28|75))[1-46]|(?:2(?:16|21|83)|3(?:[01]4|33|46|8[17]|93)|4(?:17|5[346]|76|9[37])|574|6(?:33|78|91)|7(?:08|35|5[12])|8(?:12|35|49))[1-7]|(?:1(?:0[238]|1[134])|2(?:11|52|6[35]|88|94)|3(?:5[579]|65|75|89|9[29])|496|7(?:01|34|47|62)|8(?:[34]1|69|73))[1-9]|(?:117|2(?:07|19|82)|3(?:02|2[18]|4[34]|66|74)|4(?:16|25|43|91)|5(?:14|32|62)|6(?:22|41)|7(?:33|44|56)|8(?:07|1[68]))[1-4]|7(?:38|69)[13-6]|(?:2(?:(?:[02]|3)0|87)|3[08]0|5(?:3[04]|44|60)|8(?:40|84))[09]|(?:271|305|4(?:3[46]|50|81)|5(?:21|36|45)|6(?:35|51|9[23])|768|8(?:37|5[2-4]))[1-3]|(?:1(?:0[4679]|1[05])|2(?:[04]2|67)|3(?:1[38]|3[28]|64|71)|4(?:12|33|48|55|94)|566|634|7(?:06|18|45)|8(?:2[45]|5[159]|62|85))[1-8]|(?:1(?:0[15]|1[29])|2(?:14|53)|3(?:0[13]|29|42|79)|4(?:[12]4|3[57]|49|64|83|95)|512|6(?:1[13]|45)|7(?:17|92)|8(?:0[45]|19|67))[1-6]|(?:1(?:16|2[0-2])|2(?:1[38]|25|4[36])|3(?:15|2[367]|56|73|85|94)|4(?:2[37]|52|63|84)|5(?:0[5689]|23|46|67)|6(?:0[34]|42|62|7[79])|7(?:1[69]|2[18]|54|7[78])|8(?:27|39|48|56))[1-5]|(?:2(?:32|86)|367|4(?:21|72|92)|5(?:41|7[15]|93)|7(?:07|12|36)|8(?:11|5[78]))[12]|(?:2(?:1[02]|4[49]|60|70|8[04])|3(?:[23]|4)0|4(?:1[05]|20|30|60|70|90)|5(?:[12]0|31|4[02]|54|6[35]|70|8[02])|6(?:1[02]|20|30|40|60|7[01])|7(?:[12]0|37|40|5[07]|60|70|80|9[04])|8(?:[02]0|3[368]|50|60))0|316[1-35]|9(?:0(?:1[129]|8[1-689])|16[1-57-9]|22[1-68]|4(?:0[078]|3[13-8])|(?:21|45)1|5(?:4[12457-9]|61)|6(?:0[089]|4[13])|09[0-9]|(?:1[24]|3[12]|51)[1-7]|02[1-9]|7(?:0[07]|3[03-9]|4[0-9]|5[12467]|6[1-46]|[27][1-7]|8[1-49]|9[1-9])|(?:0[67]|18|35|4[46]|53|65)[1-4]|8(?:1[1-4]|2[13-6])|33[09]|(?:11|42|52)[1-3]|17[1-8]|(?:13|24|34|47|55|6[37]|83)[1-6]|(?:15|23|3[67]|4[89]|6[268])[1-5]|(?:61|84)[12]|(?:0[03]|10|20|30|50|80)0|9(?:0[09]|1[2-57-9]|2[1-3]|3[1-8]|4[1-6]|5[1-5]|6[12]|70|8[1-35])))$/].itthon { group: "[HU] specifikus szabályok"; throwError: "érvénytelen irányítószám"; assertMatch: "node addr:postcode=H-1051"; assertMatch: "node addr:postcode=10511"; assertNoMatch: "node addr:postcode=1051"; }
Rules_HungarySpecific.validator.mapcss, Rules_HungarySpecific.zip
Last modified
23 hours ago
Last modified on 2026-10-23T14:14:38+02:00
Attachments (1)
- Flag_of_Hungary.svg (223 bytes ) - added by 4 years ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.


