Skip to content

Commit

Permalink
More fixes.
Browse files Browse the repository at this point in the history
refs: #5236
  • Loading branch information
mattjdnv committed Feb 11, 2022
1 parent 747f708 commit 341f8da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 7 additions & 4 deletions translations/mgcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ mgcp = {
}
else
{
// Moving to upper case as a test
if (mgcp.configIn.OgrAddUuid == 'true') tags.uuid = createUuid();
}

Expand Down Expand Up @@ -1929,15 +1930,16 @@ 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'])
{
attrs.UID = 'raw_id:' + tags['hoot:id'];
}
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
Expand Down Expand Up @@ -2040,7 +2042,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');
Expand Down Expand Up @@ -2395,7 +2397,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();
Expand Down
5 changes: 2 additions & 3 deletions translations/mgcp_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 341f8da

Please sign in to comment.