Skip to content

Add Poland rail stations, scraper, and schedule integration#32

Merged
R4ULtv merged 16 commits into
previewfrom
feat/pl-stations
May 16, 2026
Merged

Add Poland rail stations, scraper, and schedule integration#32
R4ULtv merged 16 commits into
previewfrom
feat/pl-stations

Conversation

@R4ULtv

@R4ULtv R4ULtv commented May 11, 2026

Copy link
Copy Markdown
Owner

This PR introduces full support for Polish railway data, including new station entries, country mapping, carrier identification, and a dedicated scraper with API key handling. It also integrates schedule information and cleans up obsolete data.

Key Changes

  • Added 1000+ Polish rail stations to stations.geojson
  • Updated country map with Poland and introduced ID prefixes for Polish entities
  • Implemented a new Poland train scraper with configurable API key support
  • Integrated schedule data retrieval for Poland into the existing scraper pipeline
  • Mapped Polish carriers to their corresponding train brands
  • Removed obsolete stations from the geojson file
  • Fixed fetch error logging in the utility to reduce noise

Technical Details

  • Scraper uses fetchWithTimeout with proper error handling; removed redundant logging.
  • API key is read from environment variable POLAND_API_KEY.
  • ID prefixes follow the pattern PL- for all new entities.
  • Schedule data is normalized to match existing format.

Impact

  • Enables the application to display and query Polish train routes.
  • Improves data accuracy by cleaning outdated stations.
  • Provides a scalable foundation for adding additional country-specific scrapers.

R4ULtv added 7 commits May 11, 2026 09:46
- Add PLK_API_KEY binding to env.ts to enable Polish rail data
- Implement Poland scraper (poland.ts) to fetch operations, map to Train
- Register scraper in apps/api/src/scrapers/index.ts
- Log fetch errors in fetch.ts to aid debugging of scraper failures
- Add PolandSchedule interfaces and helper to derive route endpoints
- Fetch schedules in parallel with operations and build route map
- Pass schedule to mapTrain to populate trainNumber and platform
- Use endpoint names as origin or destination when available
- Return combined fetch timing for trains and schedules
@R4ULtv R4ULtv self-assigned this May 11, 2026
@R4ULtv R4ULtv added the enhancement New feature or request label May 11, 2026
@vercel

vercel Bot commented May 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rail-radar Ready Ready Preview, Comment May 14, 2026 7:47am

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
rail-radar 9402229 Commit Preview URL

Branch Preview URL
May 14 2026, 07:47 AM

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown

Station Data Change Report

➕ Stations Added (1183)
ID Name Type Coordinates
PL10009 Korsze rail 54.1724271, 21.13634
PL10033 Sątopy-Samulewo rail 54.0729258, 21.0240856
PL1008 Świnoujście rail 53.9044446, 14.2660228
PL10264 Tołkiny rail 54.1168951, 21.2359043
PL10405 Kętrzyn rail 54.0723561, 21.387517
PL10603 Szczytno rail 53.5602225, 20.9968148
PL10629 Szymany rail 53.4869372, 20.9664688
PL10769 Spychowo rail 53.5909702, 21.3542998
PL109 Szczecin Port Centralny rail 53.4133083, 14.5657986
PL10900 Morąg rail 53.9190188, 19.9228513
PL10934 Pasłęk rail 54.0553482, 19.656533
PL10942 Bogaczewo rail 54.1001286, 19.5729376
PL10983 Małdyty rail 53.9210231, 19.7360446
PL1107 Szczecin Dąbie rail 53.3913468, 14.6704623
PL11155 Żabi Róg rail 53.8764039, 20.0176074
PL11254 Braniewo rail 54.3809392, 19.8421521
PL11346 Orneta rail 54.1149846, 20.1507532
PL117168 Dzierżążno rail 54.3150695, 18.2661106
PL11809 Ełk rail 53.8243458, 22.363054
PL11833 Stare Juchy rail 53.9251916, 22.1683258
PL11841 Woszczele rail 53.8596729, 22.2489843
PL11858 Wydminy rail 53.9762682, 22.033529
PL119206 Zegrze Południowe rail 52.4519364, 21.0082343
PL1198 Kliniska rail 53.4608622, 14.7840205
PL12229 Prostki rail 53.6951398, 22.4317785
PL12252 Grajewo rail 53.650103, 22.448183
PL12328 Drygały rail 53.6791251, 22.103853
PL12369 Pisz rail 53.6318225, 21.7947449
PL12609 Giżycko rail 54.0314031, 21.7777295
PL12633 Siedliska rail 54.0002743, 21.914535
PL12641 Sterławki Wielkie rail 54.0157843, 21.5821207
PL12807 Suwałki rail 54.1058152, 22.9453382
PL12872 Trakiszki rail 54.2394528, 23.2080095
PL12963 Augustów rail 53.8527155, 23.025974
PL13003 Kostrzyn rail 52.5913607, 14.6469745
PL13052 Namyślin rail 52.6781517, 14.5704471
PL13078 Ługi Górzyckie rail 52.5153806, 14.6509453
PL13094 Laski Lubuskie rail 52.4598324, 14.7126655
PL13128 Kowalów rail 52.3973183, 14.7598155
PL13250 Godków rail 52.9012177, 14.4585835
PL13334 Chojna rail 52.9638559, 14.4439586
PL13417 Mieszkowice rail 52.7817383, 14.4858725
PL13425 Boleszkowice rail 52.7364987, 14.5189402
PL13904 Gorzów Wielkopolski rail 52.7276526, 15.2286373
PL13938 Gorzów Wielkopolski Zieleniec rail 52.6994982, 15.262029
PL14027 Bogdaniec rail 52.6893373, 15.0794046
PL14035 Nowiny Wielkie rail 52.6726549, 15.0028876
PL1404 Goleniów rail 53.5594624, 14.839589
PL14043 Witnica rail 52.6673743, 14.8960523
PL1420 Białuń rail 53.6152375, 14.8410252
... 1133 more stations ... ...

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f36229f4ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/api/src/scrapers/poland.ts Outdated
Comment thread apps/api/src/scrapers/poland.ts
Comment thread apps/api/src/scrapers/poland.ts
R4ULtv added 3 commits May 11, 2026 17:02
Enforce PL prefix (PLNN) when parsing Polish station IDs
Compute stationNumber earlier in scrapePolandTrains
Remove redundant reassignment of stationNumber
R4ULtv added 4 commits May 14, 2026 08:51
- Introduced in-memory cache for Poland raw train data with a 15s TTL.
- Added PolandRawData and PolandRawCacheEntry types and rawDataCache
  map.
- Implemented fetchPolandRawData and getCachedPolandRawData helpers.
- Refactored scrapePolandTrains to use cached data instead of direct
  fetch
@R4ULtv R4ULtv merged commit c80c05f into preview May 16, 2026
4 checks passed
@R4ULtv R4ULtv deleted the feat/pl-stations branch June 20, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant