Skip to content

Commit 26cf34b

Browse files
authored
Landuse Fixes (#5680)
* Landcover fixes refs: #5652 * More fixes refs: #5652
1 parent 9042e94 commit 26cf34b

File tree

13 files changed

+1329
-558
lines changed

13 files changed

+1329
-558
lines changed

translations/fcode_common.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fcodeCommon = {
187187
['F_CODE','AP050','highway','path'], // Trail
188188
['F_CODE','AP055','highway','tank_trail'], // Tank Trail
189189
['F_CODE','AP056','crossing','tank'], // Tank Crossing
190-
['F_CODE','AQ035','sidewalk','yes'], // Sidewalk
190+
['F_CODE','AQ035','footway','sidewalk'], // Sidewalk
191191
['F_CODE','AQ040','bridge','yes'], // Bridge
192192
['F_CODE','AQ045','bridge:span','yes'], // Bridge Span
193193
['F_CODE','AQ050','bridge:superstructure','yes'], // Bridge Superstructure
@@ -305,7 +305,7 @@ fcodeCommon = {
305305
['F_CODE','BH110','pipeline:type','penstock'], // Penstock
306306
['F_CODE','BH116','natural','aquifer'], // Aquifer
307307
['F_CODE','BH120','waterway','rapids'], // Rapids
308-
['F_CODE','BH135','landuse','rice_field'], // Rice Field
308+
['F_CODE','BH135','crop','rice'], // Rice Field
309309
['F_CODE','BH140','waterway','river'], // River - See custom rules
310310
['F_CODE','BH145','waterway','vanishing_point'], // Vanishing point
311311
['F_CODE','BH150','natural','salt_flat'], // Salt Flat, Salt Pan
@@ -367,7 +367,7 @@ fcodeCommon = {
367367
['F_CODE','EA031','garden:type','botanical'], // Botanical Garden
368368
['F_CODE','EA040','landuse','orchard'], // Orchard/Plantation
369369
['F_CODE','EA050','landuse','vineyard'], // Vineyard
370-
['F_CODE','EA055','landuse','hop_garden'], // Hop Field
370+
['F_CODE','EA055','crop','hop'], // Hop Field
371371
['F_CODE','EB010','natural','grassland'], // Grassland
372372
['F_CODE','EB020','natural','scrub'], // Thicket (was FACC Scrub/Brush/Bush)
373373
['F_CODE','EB070','natural','brush'], // Brush - possibly "heath"

translations/ggdm30.js

Lines changed: 109 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* This will properly maintain the copyright information. Maxar
2323
* copyrights will be updated automatically.
2424
*
25-
* @copyright Copyright (C) 2014 Maxar (http://www.maxar.com/)
25+
* @copyright Copyright (C) 2014 2023 Maxar (http://www.maxar.com/)
2626
*/
2727

2828
/*
@@ -31,8 +31,6 @@
3131
OSM+ -> GGDM30
3232
3333
Also, this will import GGDM2.1
34-
35-
Based on mgcp/__init__.js script
3634
*/
3735

3836
ggdm30 = {
@@ -1104,6 +1102,11 @@ ggdm30 = {
11041102
if (tags.highway == 'pedestrian') delete tags.landuse;
11051103
break;
11061104

1105+
case 'AL270': // Industrial Farm
1106+
if (tags.trees == 'coffea_plants') tags.landuse = 'orchard';
1107+
if (tags.trees == 'tea_plants') tags.landuse = 'orchard';
1108+
break;
1109+
11071110
case 'AN010': // Railway
11081111
if (tags['railway:track'] == 'monorail')
11091112
{
@@ -1140,6 +1143,10 @@ ggdm30 = {
11401143
}
11411144
break;
11421145

1146+
case 'BH135': // Ricefield
1147+
tags.landuse = 'farmland';
1148+
break;
1149+
11431150
case 'BH140': // River
11441151
if (tags['channel:type'] == 'normal') delete tags['channel:type']; // Default value
11451152
if (tags.tidal == 'no') delete tags.tidal; // Default value
@@ -1182,15 +1189,39 @@ ggdm30 = {
11821189
}
11831190
break;
11841191

1192+
case 'EA010': // Crop Land
1193+
// Coffee is an orchard according to OSM. Tea is as well but GGDM calls it Crop Land
1194+
// Or, Industrial Farm
1195+
if (tags.trees == 'tea_plants') tags.landuse = 'orchard';
1196+
if (tags.trees == 'coffea_plants') tags.landuse = 'orchard';
1197+
if (tags.crop == 'other' && tags.trees) delete tags.crop;
1198+
break;
1199+
11851200
case 'EA031': // Botanic Garden
11861201
if (! tags.leisure) tags.leisure = 'garden';
11871202
break;
11881203

1204+
case 'EA040': // Orchard
1205+
// Crop vs Trees
1206+
if (tags.crop == 'other' && tags.trees) delete tags.crop;
1207+
break;
1208+
11891209
case 'EA050': // Vineyard
11901210
// Landuse = vineyard implies crop=grape
11911211
if (tags.crop == 'grape') delete tags.crop;
11921212
break;
11931213

1214+
case 'EA055': // Hop Field
1215+
tags.landuse = 'farmland';
1216+
1217+
// Cropland vs Orchard
1218+
if (tags.trees == 'hop_plants' && tags.crop)
1219+
{
1220+
delete tags.crop;
1221+
tags.landuse = 'orchard';
1222+
}
1223+
break;
1224+
11941225
case 'EC015': // Forest
11951226
if (geometryType == 'Line')
11961227
{
@@ -1629,7 +1660,37 @@ ggdm30 = {
16291660

16301661
case 'farm':
16311662
case 'allotments':
1632-
tags.landuse = 'farmland';
1663+
case 'farmland':
1664+
tags.landuse = 'farmland'; // For Farm and Allotments
1665+
switch (tags.crop)
1666+
{
1667+
case undefined: // Break early
1668+
break;
1669+
1670+
case 'rice':
1671+
delete tags.landuse; // Ricefield is a different F_CODE
1672+
break;
1673+
1674+
case 'tea': // Depreciated tag
1675+
tags.trees = 'tea_plants';
1676+
attrs.F_CODE = 'AL270'; // Industrial Farm
1677+
// tags.landuse = 'plantation'; // Industrial Farm
1678+
delete tags.crop;
1679+
break;
1680+
1681+
case 'coffee': // Depreciated Tag
1682+
tags.trees = 'coffea_plants';
1683+
delete tags.crop;
1684+
break;
1685+
1686+
case 'fruit_tree':
1687+
tags.landuse = 'orchard';
1688+
break;
1689+
1690+
case 'hop':
1691+
attrs.F_CODE = 'EA055'; // Hop Field
1692+
break;
1693+
}
16331694
break;
16341695

16351696
case 'farmyard': // NOTE: This is different to farm
@@ -1638,10 +1699,6 @@ ggdm30 = {
16381699
delete tags.landuse;
16391700
break;
16401701

1641-
case 'farmland':
1642-
if (tags.crop == 'fruit_tree') tags.landuse = 'orchard';
1643-
break;
1644-
16451702
case 'grass':
16461703
case 'meadow':
16471704
tags.natural = 'grassland';
@@ -1684,6 +1741,46 @@ ggdm30 = {
16841741
delete tags.landuse;
16851742
break;
16861743

1744+
case 'orchard':
1745+
switch (tags.crop)
1746+
{
1747+
case undefined: // Break early
1748+
break;
1749+
1750+
case 'tea': // Depreciated tag
1751+
tags.trees = 'tea_plants';
1752+
delete tags.crop;
1753+
break;
1754+
1755+
case 'coffee': // Depreciated Tag
1756+
tags.trees = 'coffea_plants';
1757+
delete tags.crop;
1758+
break;
1759+
1760+
case 'hop':
1761+
attrs.F_CODE = 'EA055'; // Hop Field
1762+
break;
1763+
}
1764+
1765+
switch (tags.trees)
1766+
{
1767+
case undefined: // Break early
1768+
break;
1769+
1770+
case 'tea_plants':
1771+
attrs.F_CODE = 'AL270'; // Industrial Farm
1772+
break;
1773+
1774+
case 'coffea_plants':
1775+
attrs.F_CODE = 'EA010'; // Cropland
1776+
break;
1777+
1778+
case 'hop_plants':
1779+
attrs.F_CODE = 'EA055'; // Hop Field
1780+
break;
1781+
}
1782+
break;
1783+
16871784
case 'railway':
16881785
if (tags['railway:yard'] == 'marshalling_yard') attrs.F_CODE = 'AN060';
16891786
break;
@@ -1698,12 +1795,15 @@ ggdm30 = {
16981795
tags.landuse = 'built_up_area';
16991796
break;
17001797

1701-
17021798
case 'retail':
17031799
tags.use = 'commercial';
17041800
tags.landuse = 'built_up_area';
17051801
break;
17061802

1803+
case 'rice_field': // Old translation
1804+
if (! tags.crop) tags.crop = 'rice';
1805+
break;
1806+
17071807
case 'scrub':
17081808
tags.natural = 'scrub';
17091809
delete tags.landuse;

0 commit comments

Comments
 (0)