Skip to content

Commit

Permalink
👽️ Update fixed widths for parsing stations
Browse files Browse the repository at this point in the history
  • Loading branch information
jh0ker committed May 2, 2024
1 parent e945139 commit ccec18e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scraper/src/loadStations.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ module.exports = async function loadStations (baseMinYear) {
'https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/daily/kl/recent/KL_Tageswerte_Beschreibung_Stationen.txt';
const raw = (await got(url, { encoding: 'latin1' })).body;
return parseFixedWidth(raw, {
skip: 3,
widths: [5, 9, 9, 15, 12, 10, 42, 22],
// The format was changed sometime between 2024-04-15 and 2024-05-01
//skip: 3,
//widths: [5, 9, 9, 15, 12, 10, 42, 22],
skip: 2,
widths: [21, 9, 9, 14, 12, 10, 81, 843],
names: ['id', 'from', 'to', 'altitude', 'lat', 'lon', 'name', 'state'],
})
.map(station => ({
Expand Down

0 comments on commit ccec18e

Please sign in to comment.