Skip to content

Commit

Permalink
Merge pull request #8 from geolonia/6-milt-merge-fix
Browse files Browse the repository at this point in the history
町字のマージパターン追加
  • Loading branch information
keichan34 authored Jan 7, 2025
2 parents a1b146a + eeb84c5 commit 9ae5812
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/abr_mlit_merge_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export function createMergedApiData(abrData: SingleMachiAza[], mlitData: NlftpMl
const out = abrData;

for (const row of mlitData) {
// ABRデータに重複があるかのチェック
if (abrData.find(a => (
(a.oaza_cho === row.oaza_cho && a.chome === row.chome) ||
a.koaza === row.oaza_cho
(a.oaza_cho === row.oaza_cho && a.chome === row.chome) || // 大字と丁目が一致する場合
(a.koaza === row.oaza_cho) || // 小字が一致する場合
((a.oaza_cho || '') + (a.koaza || '') === row.oaza_cho) // 大字と小字を結合したものが一致する場合
))) {
continue;
}
Expand Down

0 comments on commit 9ae5812

Please sign in to comment.