Carrier hours are now normalised in the Python pipeline (DHL, DPD, GLS,
PostNL, ViaTim, InPost — covering 75% of all points), written into the
per-municipality GeoJSON, and rendered as a weekly table (or single line
where the source only exposes a free-text window) in both the simple and
detailed marker popups. Regenerated data for all 342 municipalities.
Also: drop the legacy Folium HTML viewer from main.py (Next.js webapp is
the only supported frontend), and capture GLS openingHours/vacations in
the upstream cache.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
New shared utility (scripts/cache_guard.py) that all fetch scripts now
use. If a fetch returns >20% fewer locations than the existing cache,
the save is skipped and the process exits with code 2.
Changes:
- Add scripts/cache_guard.py with safe_save() function
- Integrate into all 7 fetch scripts (DHL, DPD, ViaTim, InPost,
Budbee, Amazon, GLS)
- Add email alerts to all 3 GitHub Actions workflows when anomalies
are detected (requires ALERT_EMAIL_USERNAME, ALERT_EMAIL_PASSWORD,
and ALERT_EMAIL_TO secrets)
- Workflows continue with preserved caches so batch generation still
runs with last-known-good data
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GLS API (apm.gls.nl/glspoints/nearby) is returning 504 timeouts since
April 6. The old Playwright-based script silently wrote 0 locations to
cache, causing GLS to drop from 961 to 0 points.
- Rewrite gls_fetch_all.py to use direct API calls (no Playwright)
- Protect cache: never overwrite with 0 results
- Remove POC fallback from api_client.py
- Restore last good cache (961 locations from March 30)
- Simplify GitHub Actions workflow (no browser install needed)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- batch_generate.py: Replace hardcoded carrier list (which included
FedEx and missed new providers) with dynamic collection from results
- data-export layout: Widen max-width from 7xl (1280px) to 1600px
to accommodate 10 provider columns in the matrix table
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ViaTim: 393 NL service points via public REST API (no auth)
- InPost: 934 operating PUDO/locker locations via EasyPack API (no auth)
- Budbee: 281 parcel lockers from DPD cache + OpenStreetMap
Backend:
- Add fetch scripts: viatim_fetch_all.py, inpost_fetch_all.py, budbee_fetch_all.py
- Add get_data_viatim(), get_data_inpost(), get_data_budbee() to api_client.py
- Wire into get_data_pakketpunten() pipeline
Frontend:
- Add provider colors, logos, and filter entries across all components
- Real brand logos: ViaTim (magenta VA monogram), InPost (yellow burst),
Budbee (green wordmark)
- Update type definitions, AboutModal data sources
CI/CD:
- Add fetch steps for ViaTim, InPost, Budbee to weekly update workflow
- Include new cache files in git commit step
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restores the Playwright-based amazon_fetch_all.py from git history and adds
a scheduled workflow (Mondays 00:30 UTC) to keep Amazon parcel point data
up to date automatically, similar to the GLS workflow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rewrite README to reflect all 7 carriers, 343 municipalities, webapp features, automation, and statistical analysis
- Add CBS data fetching, statistical analysis, PDF report generation, and validation scripts
- Add provincial boundaries generation script
- Add webapp Playwright test
- Add postal code reference data and UPS integration research
- Remove obsolete amazon_fetch_all.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FedEx only has ~3 locations in NL and Playwright scraping takes 4+ hours
with memory issues. Not worth the complexity for minimal coverage.
- Remove FedEx from api_client.py
- Remove FedEx from webapp provider lists and UI components
- Delete fetch-fedex-data.yml workflow
- Delete fedex_fetch_all.py and fedex_fetch_poc.py scripts
- Delete fedex data cache files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add fetch-gls-data.yml: Standalone GLS Playwright fetch (Sunday 00:00 UTC)
- Add fetch-fedex-data.yml: Standalone FedEx Playwright fetch (Sunday 18:00 UTC)
- Update update-data.yml: Use cached GLS/FedEx data from separate workflows
- Update api_client.py: Add POC file fallback for GLS/FedEx if main cache empty
- Update gls_fetch_all.py: Grid-based approach using 20 strategic coordinates
- Update fedex_fetch_all.py: Municipality-by-municipality Playwright approach
- Add gls_all_locations.json: 150 GLS locations from grid-based fetch
This architecture prevents long-running Playwright jobs from timing out
and blocking the main data update workflow.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Load all municipalities from municipalities_all.json
- Deduplicate results across municipality searches
- Save to cache files in format expected by api_client
- Standardize FedEx field names to match api_client expectations
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GLS and FedEx data fetching scripts (Playwright-based)
- Add GLS and FedEx cache files for nationwide data
- Update api_client.py with GLS and FedEx support
- Add canPickup/canDropoff fields to all carriers
- Update webapp with service filters (Ophalen/Verzenden)
- Add visual indicators for pickup-only/dropoff-only locations
- Update GitHub workflow to fetch GLS/FedEx data
- Add GLS logo
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Amazon Hub Lockers & Counters data (1,217 locations)
- Browser automation via Playwright to scrape amazon.nl/ulp
- Search by municipality name with autocomplete selection
- Cached in data/amazon_all_locations.json
- Implement persistent municipality polygon cache
- Cache stored in data/municipality_polygon_cache.json
- Time-based expiry: refreshes last week of June/December
- Eliminates Overpass API timeouts during batch processing
- All 342 municipalities pre-cached
- Update webapp About modal
- Add Amazon as data source
- Add academic paper link (CO2 impact of pickup points)
- Update carrier status to include Amazon
- Improve municipality selector
- Nederland now sticky at bottom of dropdown
- Always visible regardless of search filter
- Keyboard navigation includes Nederland option
- Regenerate all municipality GeoJSON files with Amazon data
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The update script was skipping nederland.geojson to avoid double-counting,
but this meant the Nederland row in the data matrix only had 2 weeks of
history. Now the script syncs the nederland municipality entry from the
snapshot totals on every run.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added backfill script to extract historical data from git commits
- Populated 6 weeks of history (W47-W52)
- Fixed W52 data to match actual commit values
- Set minimum week to W47 (API improvements were made before this)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace git-based history extraction with a simpler append-only approach:
- New update_totals_history.py script appends weekly snapshots
- totals_history.json grows incrementally over time
- No more git history parsing needed for historical data
- Seeded with existing 2 weeks of data + current week
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add scripts/generate_history.py to extract historical data from git commits
- Generate history.json with weekly snapshots (from W47 onwards)
- Add trend indicators (visible on hover) to overview stats
- Add clickable municipality rows with history modal showing:
- Summary stats (current total, change since start)
- Interactive line chart with recharts
- Weekly data table with date ranges and differences
- Update GitHub Actions to generate history.json after data updates
- Fix AboutModal mobile clipping issue (reduce max-height)
- Mobile-responsive design for all new components
🤖 Generated with [Claude Code](https://claude.ai/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Problem
Rotterdam (and other cities) were missing 59+ DHL locations in city centers
(Beursplein, Coolsingel, Blaak, Markthal, Lijnbaan, etc.)
## Root Causes Fixed
1. **GitHub Actions workflow bug** (.github/workflows/update-data.yml)
- Weekly workflow regenerated DHL cache but didn't commit it
- Next week's run used stale October 26 cache
- FIX: Added cache files to git commit step
2. **Grid subdivision minimum radius too large** (scripts/dhl_grid_fetch.py)
- Was 2km minimum, too large for dense city centers
- Dense areas hit 50-result API limit even at 2-5km radius
- FIX: Changed minimum to 100m for deeper subdivision
3. **CRITICAL: Subdivision coordinate bug** (scripts/dhl_grid_fetch.py)
- offset_km calculation treated meters as kilometers (5000m → 5000km!)
- Generated coordinates in Antarctica/Arctic (lat 82°, lon -44°)
- Subdivided cells were never processed properly
- FIX: Added division by 1000 to convert meters → km
## Results
- DHL cache: 4,115 → **4,247 locations** (+132, +3.2%)
- Rotterdam: 87 → **145 DHL locations** (+58, +67%)
- **All city center locations restored** ✓
## Technical Details
- Grid fetch now subdivides: 10km → 5km → 2.5km → 1.25km → 625m → 312m → 156m
- Stops at 100m minimum or when results < 50
- 814 total API calls (590 initial + 224 subdivisions)
- Cache size: 18.6 MB (4,247 locations)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds retry logic with exponential backoff and graceful fallback to Nominatim geocoding when Overpass API is unavailable. This prevents GitHub Actions from failing when transient API timeouts occur (e.g., Berkelland 504 errors).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
CRITICAL BUG FIX: The previous 15km grid spacing with 10km search radius
left gaps in coverage, missing city centers like Rotterdam.
Changes:
- Grid spacing: 15km → 12km
- Grid cells: 385 → 590 (+53%)
- Rotterdam city center: 0 grid points → 2 grid points covering it
Impact:
- Rotterdam center (51.92°N, 4.47°E) now covered by:
- Grid point at 51.94°N, 4.54°E (5.09 km away) ✅
- Grid point at 51.94°N, 4.36°E (7.68 km away) ✅
This will require re-fetching the DHL cache to capture missing locations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes for 28 failed municipalities in GitHub Actions run:
1. **Retry logic with exponential backoff**:
- Added 3-attempt retry for Overpass API timeouts (504, 503, 429)
- Exponential backoff: 2s, 4s, 8s between retries
- Prevents transient API issues from causing permanent failures
2. **Municipality name mappings**:
- 's-Hertogenbosch: Maps to "s-Hertogenbosch" (OSM uses without apostrophe)
- Bergen (L.) and Bergen (NH.): Maps to "Bergen" (OSM doesn't use parentheses)
- Nuenen: Maps to full name "Nuenen, Gerwen en Nederwetten"
3. **Backfill script**:
- Created scripts/backfill_failed_municipalities.py
- Reprocesses 28 municipalities that failed in last run
- Uses improved retry logic and name mappings
- Provides detailed success/failure reporting
Expected improvement: All 28 previously failed municipalities should now process successfully.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major changes:
- Updated utils.py to use Overpass API with admin_level=8 for complete municipality boundaries
- Fixed geometry extraction to properly connect OSM way segments using linemerge
- Added caching to minimize API calls
- Fixed file paths in dhl_grid_fetch.py and dpd_fetch_all.py for GitHub Actions compatibility
- Removed deprecated integration scripts (now part of batch_generate.py)
- Regenerated all municipality GeoJSON files with correct boundaries
Rotterdam verification:
- Old boundary: west 4.38° (city center only, 311 points)
- New boundary: west 3.94° (full municipality, 343 points)
- Now includes Hoek van Holland and Rozenburg as expected
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Instead of failing when a municipality has no pakketpunten data,
now creates a valid empty GeoJSON file with proper metadata.
This ensures all municipalities have a consistent file structure
and prevents 404 errors in the webapp when loading municipalities
with no parcel pickup points.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Since the webapp is deployed on Vercel, which automatically handles
gzip compression at the edge with optimal settings, pre-compressed
.gz files are unnecessary and add complexity.
Changes:
- Deleted all 345 .geojson.gz files (~63 MB)
- Removed gzip compression from batch_generate.py
- Removed gzip compression from create_national_overview.py
- Deleted compress_geojson_files.py utility script
- Updated GitHub Actions workflow to not track .gz files
- Middleware remains disabled (Vercel handles compression)
Vercel automatically compresses responses on-the-fly and caches them
on edge servers globally, providing better performance than serving
pre-compressed static files.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Generated .geojson.gz versions for all 341 municipality files
- Added compress_geojson_files.py utility script for compression
- Compression achieves 80.7% average size reduction (63.21 MB saved)
- Next.js middleware automatically serves .gz files when available
- Major cities: Amsterdam (1.7MB→270KB), Rotterdam (1.4MB→223KB), Den Haag (1.1MB→168KB)
- National overview: Nederland (5.9MB→520KB, 91% reduction)
The webapp automatically chooses between gzipped and unzipped versions
via middleware, providing transparent compression for faster loading.
Weekly updates will continue to generate .gz files automatically.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Fix summary.json path in batch_generate.py to use absolute path
- Add create_national_overview.py step to main workflow
- Update git add command to include summary.json
- Add test workflow for Zwolle and Elburg only
This ensures all generated files are written to webapp/public/data/
and properly committed to the repository for Vercel deployment.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add pre-compression of all geojson files to .gz format
- Update batch_generate.py to generate .gz files (85-90% size reduction)
- Update create_national_overview.py to generate .gz files for nederland
- Add Next.js middleware to serve pre-gzipped files
- Fix path resolution in batch_generate.py to work from repo root
- Update GitHub Actions workflow to commit .gz files
Major changes:
1. Project Reorganization
- Move documentation to docs/ directory
- Move data files to data/ directory
- Move scripts to scripts/ directory
- Improve project structure and maintainability
2. Amazon Hub Integration (OpenStreetMap)
- Implement complete Amazon Hub data pipeline
- Add amazon_fetch_all.py for OSM Overpass API fetching
- Add integrate_amazon_data.py for municipality integration
- Add get_data_amazon() function to api_client.py
- Integrate into weekly_update.py workflow
- Add comprehensive documentation in DATA_SOURCES.md
Note: Amazon is currently DISABLED in pipeline
- No Amazon location data in OpenStreetMap for NL
- Infrastructure ready for future when OSM data available
- Can be enabled by uncommenting code in api_client.py and weekly_update.py
3. Additional Provider Updates
- Add DPD complete fetch and integration scripts
- Add FedEx integration support (cache-based)
- Update provider handling in api_client.py
4. Documentation Updates
- Add Amazon Hub section with OSM attribution
- Document alternative data sources explored
- Update CLAUDE.md with current architecture
- Reorganize all docs in docs/ directory
🤖 Generated with Claude Code (https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>