From 5b84fd0159ad9490dce296942fbf9a3b79746a47 Mon Sep 17 00:00:00 2001 From: Matt Jackson Date: Tue, 15 Feb 2022 11:20:49 +0000 Subject: [PATCH] MGCP fixes (#5247) * More fixes. refs: #5236 * Removed commented out line refs: #5236 --- translations/mgcp.js | 10 ++++++---- translations/mgcp_rules.js | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/translations/mgcp.js b/translations/mgcp.js index 12154e9df7..7d18db99f7 100644 --- a/translations/mgcp.js +++ b/translations/mgcp.js @@ -1929,7 +1929,7 @@ mgcp = { if (tags.uuid) { var str = tags['uuid'].split(';'); - attrs.UID = str[0].replace('{','').replace('}',''); + attrs.UID = str[0].replace('{','').replace('}','').toUpperCase(); } else if (tags['hoot:id']) { @@ -1937,7 +1937,8 @@ mgcp = { } else { - if (mgcp.configOut.OgrAddUuid == 'true') attrs.UID = createUuid().replace('{','').replace('}',''); + // Moving to upper case as a test + if (mgcp.configOut.OgrAddUuid == 'true') attrs.UID = createUuid().replace('{','').replace('}','').toUpperCase(); } // The follwing bit of ugly code is to account for the specs haveing two different attributes @@ -2040,7 +2041,7 @@ mgcp = { attrs.FFN = '931'; } - if (attrs.FFN && (attrs.FFN !== '930' && attrs.FFN !== '931')) + if (attrs.FFN && (attrs.FFN !== '930' && attrs.FFN !== '931' && attrs.FFN !== '0')) { // Debug //print('AL015: Setting HWT 998'); @@ -2395,7 +2396,8 @@ mgcp = { // Add some metadata if (! tags.uuid) { - if (mgcp.configIn.OgrAddUuid == 'true') tags.uuid = createUuid(); + // Upper case as a test + if (mgcp.configIn.OgrAddUuid == 'true') tags.uuid = createUuid().toUpperCase(); } if (! tags.source) tags.source = 'mgcp:' + layerName.toLowerCase(); diff --git a/translations/mgcp_rules.js b/translations/mgcp_rules.js index caff983856..6d7bc72299 100644 --- a/translations/mgcp_rules.js +++ b/translations/mgcp_rules.js @@ -147,7 +147,6 @@ mgcp.rules = { ['F_CODE','BH130','landuse','reservoir'], // From OSM ['F_CODE','BH130','man_made','reservoir'], // Reservoir - NFDD BH082 ['F_CODE','BH155','man_made','salt_pond'], // Due to the default translation changing - ['F_CODE','BH170','natural','waterhole'], // Natural Pool ['F_CODE','DB090','embankment','berm'], ['F_CODE','DB090','embankment','divider'], ['F_CODE','DB090','embankment','fill'], @@ -1143,7 +1142,7 @@ mgcp.rules = { // ['SWT','0',undefined,undefined], // Unknown ['SWT','0','spring:type','unknown'], // Unknown ['SWT','4','spring:type','spring'], // Spring - Will remove this in post processing - ['SWT','5','natural','waterhole'], // Water-hole + ['SWT','5','water','water-hole'], // Water-hole ['SWT','999','spring:type','other'], // Other // TID - Tide Influenced @@ -2333,7 +2332,7 @@ mgcp.rules = { // Attribute values that are to be dropped since they are defaults or don't add value. dropList : { '-32765':1,'-32767':1,'-32768':1, '-32765.0':1,'-32767.0':1,'-32768.0':1, - '998':1,'n_a':1,'n/a':1,'unknown':1,'unk':1 }, + '998':1,'n_a':1,'n/a':1,'unknown':1,'unk':1,'fcsubtype':1 }, // ##### End of dropList ##### // Attribute names to swap on input. These are to avoid having copies of the same translation.