Skip to content

Commit

Permalink
feat(layers): map PCLD feature code to dependency (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink authored Nov 10, 2021
1 parent 2f514b8 commit ce8bac5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/streams/layerMappingStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ function featureCodeToLayerDefault(featureCode) {
switch (featureCode) {
case 'PCLI':
return 'country';
case 'PCLD':
return 'dependency';
case 'ADM1':
return 'region';
case 'ADM2':
Expand Down
10 changes: 10 additions & 0 deletions test/streams/layerMappingStreamTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ tape('featureCodeToLayer', function(test) {
t.end();
});

test.test('PCLI maps to country', function (t) {
t.equal(featureCodeToLayer('PCLI'), 'country', 'Geonames PCLI maps to country layer');
t.end();
});

test.test('PCLD maps to dependency', function (t) {
t.equal(featureCodeToLayer('PCLD'), 'dependency', 'Geonames PCLD maps to dependency layer');
t.end();
});

test.test('ADM1 maps to region', function(t) {
t.equal(featureCodeToLayer('ADM1'), 'region', 'Geonames ADM1 maps to region layer');
t.end();
Expand Down

0 comments on commit ce8bac5

Please sign in to comment.