mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-22 11:39:30 -07:00
Add intelligent station name processor
This is intended to replace the simple regex truncation (`city.match(/[^,/;\\-]*/)[0].substr(0, 12)`) with a file that has all the station name processing already pre-processed by the logic in the stations post-processor script. It uses priority-based conflict resolution to avoid duplicate station names by using airport classification hierarchy. It handles complex naming patterns including military facilities, county airports, hyphenated cities, slash/comma separators, and "at/near" qualifiers with a minium number of exceptions. This changes station data pipeline to generate stations-raw.json first, then process through the post-processor to create the final stations.json compatible with existing codebase.
This commit is contained in:
16130
datagenerators/output/stations-raw.json
Normal file
16130
datagenerators/output/stations-raw.json
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1247
datagenerators/stations-postprocessor.mjs
Normal file
1247
datagenerators/stations-postprocessor.mjs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@ for (let i = 0; i < chunkStates.length; i += 1) {
|
|||||||
next = stations?.pagination?.next;
|
next = stations?.pagination?.next;
|
||||||
round += 1;
|
round += 1;
|
||||||
// write the output
|
// write the output
|
||||||
writeFileSync('./datagenerators/output/stations.json', JSON.stringify(output, null, 2));
|
writeFileSync('./datagenerators/output/stations-raw.json', JSON.stringify(output, null, 2));
|
||||||
}
|
}
|
||||||
while (next && stations.features.length > 0);
|
while (next && stations.features.length > 0);
|
||||||
console.log(`Complete: ${state}`);
|
console.log(`Complete: ${state}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user