Skip to content

Commit 15d559b

Browse files
fix extranneous attrs for certain geometry types (#5783)
Co-authored-by: Tim OLeary <olearytd@users.noreply.github.com>
1 parent 5bdbe44 commit 15d559b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

translations/tds71.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ tds71 = {
370370

371371

372372
// validateThematicAttrs - Clean up the TDS format attrs. This sets all of the extra attrs to be "undefined"
373-
validateThematicAttrs: function(gFcode, attrs) {
373+
validateThematicAttrs: function(gFcode, attrs, geometryType) {
374374
var tdsAttrList = tds71.thematicLookup[tds71.thematicGroupList[gFcode]];
375375
var attrList = tds71.attrLookup[gFcode];
376376

@@ -401,7 +401,7 @@ tds71 = {
401401
// Fix default values of closure list attributes
402402
if (tds71.configOut.OgrCodedValues)
403403
{
404-
if (['GB005','GB015','GB045'].includes(attrs['F_CODE']))
404+
if (['GB005','GB015','GB045'].includes(attrs['F_CODE']) && geometryType == 'Area')
405405
{
406406
attrs['GSGCHC'] = '-999999';
407407
attrs['GSGCLC'] = '-999999';
@@ -414,15 +414,15 @@ tds71 = {
414414
}
415415

416416
// Fix values of attributes that are not associated with subtype
417-
if (['AP050','AQ040','AP010'].includes(attrs['F_CODE']))
417+
if (['AP050','AQ040','AP010'].includes(attrs['F_CODE']) && geometryType == 'Line')
418418
{
419419
attrs['SGCC'] = '-999999';
420420
attrs['RMWC'] = '-999999';
421421
}
422422
}
423423
else
424424
{
425-
if (['GB005','GB015','GB045'].includes(attrs['F_CODE']))
425+
if (['GB005','GB015','GB045'].includes(attrs['F_CODE']) && geometryType == 'Area')
426426
{
427427
attrs['GSGCHC'] = 'noInformation';
428428
attrs['GSGCLC'] = 'noInformation';
@@ -435,7 +435,7 @@ tds71 = {
435435
}
436436

437437
// Fix values of attributes that are not associated with subtype
438-
if (['AP050','AQ040','AP010'].includes(attrs['F_CODE']))
438+
if (['AP050','AQ040','AP010'].includes(attrs['F_CODE']) && geometryType == 'Line')
439439
{
440440
attrs['SGCC'] = 'noInformation';
441441
attrs['RMWC'] = 'noInformation';
@@ -2734,7 +2734,7 @@ tds71 = {
27342734
}
27352735

27362736
// Custom Aeronautic rules
2737-
if (['GB005','GB015','GB045'].includes(attrs.F_CODE))
2737+
if (['GB005','GB015','GB045'].includes(attrs.F_CODE) && geometryType == 'Area')
27382738
{
27392739
attrs.GSGCHC = '-999999';
27402740
attrs.GSGCLC = '-999999';
@@ -3450,7 +3450,7 @@ tds71 = {
34503450
if (tds71.configOut.OgrThematicStructure == 'true')
34513451
{
34523452
returnData[i]['tableName'] = tds71.thematicGroupList[gFcode];
3453-
tds71.validateThematicAttrs(gFcode, returnData[i]['attrs']);
3453+
tds71.validateThematicAttrs(gFcode, returnData[i]['attrs'], geometryType);
34543454
}
34553455
else
34563456
{

0 commit comments

Comments
 (0)