osm-pt-validator

module
v0.0.0-...-b3d974f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: MIT

README

OSM public transport validator

Validator for public transport bus routes in OpenStreetMap.

Provided as a Go script (runnable from terminal) and an AWS application for daily verification.

Features

  • Validates tags on the relation
  • Validates that platforms/stops are ordered before ways
  • Validates that ways are correctly ordered in a continuous path
  • Validates that oneway ways are traversed in the correct direction
  • Validates that nodes have expected tags
  • Validates order of stops, and they are part of the route

Limitations

  • Only for bus routes

Script

# go run scripts/validate/main.go [-npt] -r <relationId>
go run scripts/validate/main.go -r 103630
Usage:
  -f string
        Routes file (validation config read from file too)
  -npt
        Verify NaPTAN platform tags
  -r int
        Relation ID

AWS application

Requires AWS CDK to be installed

make deploy

Looks for .json files in s3://<bucketName>/routes/**.json

See routefile.schema.json for the JSON-schema or routes for example files.

Tasks

xcfile.dev tasks

apply

requires: upload-cmd directory: stack environment: AWS_PROFILE=osmptv

terraform apply -var-file=tfvars/pro.tfvars -auto-approve
build-cmd

requires: clean

go run ./scripts/build-cmd --zip
clean
rm -rf build/* || true
format

directory: stack

terraform fmt --recursive
init

directory: stack environment: AWS_PROFILE=osmptv

terraform init -backend-config=tfvars/backend.tfvars
plan

requires: upload-cmd directory: stack environment: AWS_PROFILE=osmptv

terraform plan -var-file=tfvars/pro.tfvars
sast
wget -O .golangci.json https://raw.githubusercontent.com/ockendenjo/actions/refs/heads/main/.golangci.json
golangci-lint run
govulncheck ./...
test
go test -json ./... | tparse
upload-cmd

requires: build-cmd environment: AWS_PROFILE=osmptv

#!/bin/bash
source stack/tfvars/.env
BINARY_BUCKET=$BINARY_BUCKET go run ./scripts/upload-binaries

Directories

Path Synopsis
cmd
trigger command
validate-rm command
validate-route command
pkg
osm
scripts
build-cmd command
upload-binaries command
validate command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL