PowerShell scripts for processing route XML files and tracking changes over time. This tool is designed to process multiple XML files containing route information, detect changes between runs, and generate delta files for efficient data updates.
- Process multiple XML files in a batch
- Track changes between runs
- Generate delta files (added/modified/deleted entities)
- Maintain historical versions
- Detailed logging
- Organize data by route number
/RouteData
/current # Current version of all routes
/8411
lines.json
routes.json
...etc
/8412
lines.json
routes.json
...etc
/archive # Historical versions
/20231207_120000
/8411
/8412
/delta # Only changed data
/20231207_120000
/8411
added.json
modified.json
deleted.json
/8412
added.json
modified.json
deleted.json
/logs # Processing logs
- Basic usage:
.\Process-Routes.ps1 -XmlFolderPath "C:\Routes\XML" -OutputPath "D:\RouteData"- Generate only delta files without updating current version:
.\Process-Routes.ps1 -XmlFolderPath "C:\Routes\XML" -OutputPath "D:\RouteData" -GenerateDeltaOnlyProcess-Routes.ps1: Main processing scriptXmlProcessor.psm1: XML processing module with entity extraction functions
- PowerShell 5.1 or later
- Write permissions to output directory
- Lines
- Routes
- Route Points
- Journey Patterns
- Stop Sequences
- Service Journeys
- Passing Times
- Dated Journeys
For each route number and entity type, the following files may be generated:
{entityType}.json: Current version of the data
{entityType}_added.json: New entities{entityType}_modified.json: Changed entities{entityType}_deleted.json: Removed entities
Processing logs are stored in the logs directory with timestamp:
process_YYYYMMDD_HHMMSS.log