Skip to content

Commit

Permalink
update discard_tags
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed Feb 19, 2023
1 parent 524c903 commit c34689a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/actions/discard_tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ const nzCrap = {
'http://www.linz.govt.nz/topography/topo-maps/index.aspx': 'LINZ',
'http://www.linz.govt.nz/about-linz/linz-data-service/dataset-information': 'LINZ',
'http://www.stats.govt.nz/browse_for_stats/people_and_communities/Geographic-areas/digital-boundary-files.aspx': 'Statistics NZ',
},
source: {
'LINZ & NZ Open GIS': 'LINZ',
'LINZ;NZ Open GIS': 'LINZ',
'LINZ/NZOGPS': 'LINZ',
'LINZ_NZ_Topo50_Gridless_Maps': 'LINZ',
'Sourced from the LINZ Data Service and licensed for reuse under CC BY 4.0': 'LINZ',
},
'source:ele': {
'LINZ Topo50': 'LINZ',
'Topo50 gridless': 'LINZ',
}
};

Expand Down Expand Up @@ -59,8 +70,11 @@ export function actionDiscardTags(difference, discardTags) {
}
}

const anyLinzRefTags = tags['ref:linz:topo50_id'] || tags['ref:linz:place_id'] || tags['ref:linz:hydrographic_id'];

// if we removed attribution=* or source_ref=*, add source=* instead
if (didDiscardLinz) {
// but not if there is already a linz:ref:* tag
if (didDiscardLinz && !anyLinzRefTags) {
if (tags.source) {
// merge with existing source tag
tags.source = [ ...new Set([didDiscardLinz, ...tags.source.split(';')])].join(';');
Expand Down

0 comments on commit c34689a

Please sign in to comment.