Skip to content

Commit bdc7b4b

Browse files
Mgcp translations (#5812)
1 parent 1c6af7a commit bdc7b4b

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

translations/mgcp.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,7 @@ mgcp = {
10321032
["t.natural =='spring' && t['spring:type'] == 'spring'","delete t['spring:type']"],
10331033
["t['pipeline:type'] == 'penstock' && t.location","delete t['pipeline:type']; t.man_made = 'pipeline'; t.usage = 'penstock'; t.substance = 'water'"],
10341034
["t.power == 'substation' && t.name","t.operator = t.name; delete t.name"],
1035+
["t.power == 'generator' && t['generator:source'] == 'wind'","t['generator:method'] = 'wind_turbine'"],
10351036
// ["t.public_transport == 'station'","t.bus = 'yes'"],
10361037
["t['social_facility:for'] == 'senior'","t.amenity = 'social_facility'; t.social_facility = 'group_home'"],
10371038
["t['subject_to_inundation'] == 'yes'","delete t['subject_to_inundation']; t.flood_prone = 'yes'"],
@@ -1150,8 +1151,32 @@ mgcp = {
11501151
if (tags.substance == 'water' )
11511152
{
11521153
tags.man_made = 'water_well';
1153-
delete tags.substance;
11541154
}
1155+
1156+
}
1157+
1158+
switch (attrs.PPO)
1159+
{
1160+
case '0':
1161+
tags.substance = 'unknown';
1162+
break;
1163+
1164+
case '45':
1165+
tags.substance = 'gas';
1166+
break;
1167+
1168+
case '75':
1169+
tags.substance = 'oil';
1170+
break;
1171+
1172+
case '122':
1173+
tags.substance = 'water';
1174+
break;
1175+
1176+
default:
1177+
tags.substance = 'other';
1178+
break;
1179+
11551180
}
11561181
break;
11571182

@@ -1680,7 +1705,7 @@ mgcp = {
16801705
case 'EC010':
16811706
delete tags.natural;
16821707
tags.crop = 'sugarcane';
1683-
tags.landuse = 'orchard';
1708+
tags.landuse = 'farmland';
16841709
break;
16851710
} // End switch FCODE
16861711

@@ -1926,14 +1951,14 @@ mgcp = {
19261951
["t.amenity == 'language_school' && t.barrier == 'wall'", "delete t.barrier"],
19271952
["t.amenity == 'language_school'", "a.FFN = '850'"],
19281953
["t.depot == 'bus' && t.landuse == 'brownfield'", "delete t.landuse; a.F_CODE = 'AL010'; a.FFN = '480'"],
1929-
["t.crop == 'sugarcane' && t.landuse == 'orchard'", "a.F_CODE = 'EC010'"], // override the Orchard FCode with Cane when Cane is the relevant crop
1954+
["t.crop == 'sugarcane' && t.landuse == 'farmland'", "a.F_CODE = 'EC010'"], // override the Orchard FCode with Cane when Cane is the relevant crop
19301955
["t.natural == 'ridge' && t.ridge == 'esker'", "a.F_CODE = 'DB100'"],
19311956
["t.landuse == 'industrial' && t.utilities", "a.F_CODE = 'AL010'; a.FFN = '350'"],
19321957
["t.public_transport == 'station'", "a.F_CODE = 'AQ125'"],
19331958
["t.tourism == 'hotel'", "a.F_CODE = 'AL010'; a.FFN = '550'"],
19341959
["t.landuse == 'basin' && t.basin == 'settling'","a.F_CODE = 'AC030'"],
19351960
["t.landuse == 'basin' && t.basin == 'aeration'","a.F_CODE = 'BH040'"],
1936-
["t.leisure == 'garden' || t.tourism == 'zoo'", "a.F_CODE = 'AL010'; a.FFN = '907'"],
1961+
["t.leisure == 'garden'", "a.F_CODE = 'AL010'; a.FFN = '907'"],
19371962
["t.leisure == 'sports_centre'", "a.F_CODE = 'AL010'; a.FFN = '912'"],
19381963
["t.natural == 'cliff' && t.surface == 'ice'", "a.F_CODE = 'BJ040'"],
19391964
["t.natural == 'peak' && t.surface == 'ice'", "a.F_CODE = 'BJ060'"],
@@ -2832,7 +2857,11 @@ mgcp = {
28322857
break;
28332858

28342859
case 'petroleum_well':
2835-
if (!tags.product) tags.product = 'oil'; // Not great
2860+
if (!tags.substance)
2861+
{
2862+
tags.substance = 'oil';
2863+
attrs.PPO = '75';
2864+
}
28362865
break;
28372866

28382867
case 'works':

translations/mgcp_rules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ mgcp.rules = {
4747
// MGCP TRDv4 Only FCODES
4848
// These are used for both import and export
4949
['F_CODE','AA012','landuse','quarry'], // Quarry - NFDD AA010
50-
['F_CODE','AA040','man_made','petroleum_well'], // Rig
5150
['F_CODE','AA050','man_made','well'], // Well - NFDD BH230 or AA054 based on Product type
5251
['F_CODE','AC000','facility','processing'], // Processing Facility - NFDD AL010
5352
['F_CODE','AH070','amenity','checkpoint'],
@@ -112,6 +111,7 @@ mgcp.rules = {
112111
// ['F_CODE','AK120','leisure','nature_reserve'], // Park (commenting out because it was translating over other features)
113112
['F_CODE','AK120','leisure','playground'], // Park
114113
['F_CODE','AK170','amenity','swimming_pool'], // Pool
114+
['F_CODE','AK180','tourism','zoo'], // Zoo
115115
['F_CODE','AK190','man_made','pier'],
116116
['F_CODE','AL010','diplomatic','embassy'], // Embassy
117117
['F_CODE','AL015','building','yes'], // To fix amenity etc

0 commit comments

Comments
 (0)