A browser-based application for generating simulated GNSS trajectory data for vehicle tracking systems. No backend required - runs entirely in the browser using IndexedDB for data persistence.
- Features
- Quick Start
- Step-by-Step Guide
- Architecture
- Screen Guide
- OpenRouteService API Setup
- Data Schema
- Export & Import
- Technical Notes
- Pure Client-Side: No server or database required
- Master Data Management: Offices, Devices, Vehicles, Deployments, Geofences
- Individual Trip Generation: Manual origin/destination selection with customizable parameters
- Batch Trip Generation: Automatic multi-day trip generation with random parameters
- Trip Viewer: Visualize generated trajectories on maps
- CSV Import/Export: Full data portability
- Dark Mode UI: GitHub-inspired dark theme
- OpenRouteService Routing: Free, open-source routing with no data storage restrictions
- Open
index.htmlin a modern browser (Chrome recommended) - Get a free OpenRouteService API key at openrouteservice.org
- Enter your API key in Settings
- Import sample CSV files from
data/sample/(Offices → Devices → Vehicles → Deployments → Geofences) - Generate trajectories using Individual or Batch generation
- View and export your data
This section provides detailed instructions from importing master data to generating trajectory data.
- Create an account at openrouteservice.org
- Complete email verification
- Go to Dashboard → Tokens and create an API token
- Enter the API key in the app's Settings page and save
Sample CSV files are provided in the data/sample/ directory. Import them in the following order:
| Order | File | Page | Contents |
|---|---|---|---|
| 1 | sample_offices.csv |
Offices | 6 offices (Tokyo, Nagoya, Osaka) |
| 2 | sample_devices.csv |
Devices | 10 tracking devices |
| 3 | sample_vehicles.csv |
Vehicles | 10 vehicles (trucks, EV, hybrid, LPG) |
| 4 | sample_deployments.csv |
Deployments | 7 device-vehicle mappings |
| 5 | sample_geofences.csv |
Geofences | 63 geofences (Tokyo/Nagoya/Osaka ward offices) |
Import Steps (repeat for each file):
- Open the corresponding page (e.g., Offices)
- Click the "Import CSV" button
- Select the sample CSV file
- Verify the imported data in the table
Important: Import in order (1→5) because Vehicles reference Offices, and Deployments reference both Devices and Vehicles.
After importing all sample files, you should have:
- 6 Offices: Tokyo HQ, Tokyo Warehouse, Nagoya Branch, Nagoya DC, Osaka Branch, Osaka Warehouse
- 10 Devices: DEV-001 to DEV-010
- 10 Vehicles: Various trucks and special vehicles (EV, Hybrid, LPG)
- 7 Deployments: 7 devices deployed to 7 vehicles
- 63 Geofences: Ward offices in Tokyo (23), Nagoya (16), and Osaka (24)
Once master data is imported, you can generate trajectory data.
- Open the Individual Gen page
- Select a Vehicle (e.g., "Tokyo Truck 1")
- Click on origin and destination geofences on the map (or select from dropdowns)
- Configure generation parameters:
- Start DateTime
- Interval (positioning interval)
- Average Speed
- Break Time
- Accuracy
- Click "Generate"
- Click "Save" to save data (CSV files are also downloaded automatically)
- Open the Batch Gen page
- Select a Vehicle
- Set the date range and Trips per Day
- Click "Start Batch Generation"
- After completion, verify on the Trips page
- View generated trips on the Trips page
- Display routes and GNSS points on the map
- Click "Export" to download CSV files
If you prefer to create master data manually instead of importing CSV files:
- Offices: Click "Add Office" and fill in company_id, office_name, prefecture_id, office_type
- Devices: Click "Add Device" and fill in serial_no, IMEI (15 digits), IMSI
- Vehicles: Click "Add Vehicle" and fill in vehicle_number, model, fuel_code
- Deployments: Click "Add Deployment" to link a device to a vehicle
- Geofences: Draw polygons on the map or enter GeoJSON geometry manually
graph TB
subgraph Browser
HTML[HTML Pages]
JS[JavaScript]
CSS[Styles]
IDB[(IndexedDB)]
end
subgraph External
ORS[OpenRouteService API]
OSM[OpenStreetMap Tiles]
LEAFLET[Leaflet.js]
end
HTML --> JS
JS --> IDB
JS --> ORS
JS --> OSM
JS --> LEAFLET
trajectory_gen_app/
├── index.html # Dashboard & Navigation
├── README.md # This file
├── html/
│ ├── offices.html # Office management
│ ├── devices.html # Device management
│ ├── vehicles.html # Vehicle management
│ ├── deployments.html # Vehicle-Device mapping
│ ├── geofences.html # Geofence management (with map)
│ ├── settings.html # OpenRouteService API configuration
│ ├── trajectory.html # Individual trip generation
│ ├── trajectory_batch.html # Batch trip generation
│ └── trips.html # Trip viewer
├── css/
│ └── style.css # GitHub dark theme styles
├── js/
│ ├── common.js # Shared utilities (IndexedDB, CSV, etc.)
│ ├── offices.js
│ ├── devices.js
│ ├── vehicles.js
│ ├── deployments.js
│ ├── geofences.js
│ ├── settings.js
│ ├── trajectory.js
│ ├── trajectory_batch.js
│ └── trips.js
└── data/
└── sample/
├── sample_offices.csv # 6 sample offices
├── sample_devices.csv # 10 sample devices
├── sample_vehicles.csv # 10 sample vehicles
├── sample_deployments.csv # 7 device-vehicle mappings
└── sample_geofences.csv # 63 geofences (Tokyo/Nagoya/Osaka)
The main navigation hub displaying data counts and quick access to all features.
flowchart LR
A[Office] --> B[Device]
A --> C[Vehicle]
B --> D[Deployment]
C --> D
D --> E[Trip Generation]
F[Geofence] --> E
| Screen | Purpose | Key Fields |
|---|---|---|
| Offices | Business locations | company_id, office_name, prefecture_id, type |
| Devices | Tracking devices | serial_no, IMEI, IMSI, fw_version |
| Vehicles | Company vehicles | vehicle_number, model, model_description |
| Deployments | Device-Vehicle mapping | device, vehicle, deploy_start, device_status |
| Geofences | Location boundaries | place_id, geofence_number, polygon |
Generate a single trip with full control over parameters.
Settings:
| Parameter | Range | Description |
|---|---|---|
| Start DateTime | Any | Trip start time |
| Interval | 1-60 sec | Position sampling rate |
| Average Speed | 10-120 km/h | Vehicle speed |
| Break Time | 0-60 min | Rest stop duration |
| Min Accuracy | 1-50 m | Best GPS accuracy |
| Max Accuracy | 1-100 m | Worst GPS accuracy |
| Outlier Rate | 0-100% | Bad position probability |
Generated Data Includes:
- Travel points along the route with random offset
- Break points (within 10m radius, 1-minute interval)
- Arrival stay points (15-60 min at destination, within 10m radius, 1-minute interval)
- Outlier points (100-2000m offset based on rate)
Automatically generate multiple trips over a date range.
Fixed Settings:
- Interval: 10 seconds (travel), 60 seconds (break/stay)
- Accuracy: 3-20 meters
- Break: Random (0, 10, 20, or 30 min)
- Speed: Random 30-60 km/h
- Outlier Rate: 0%
Time Management:
- First trip: 6:00-9:00 AM (random)
- Subsequent trips: Previous trip end + 30-120 min gap
- Trips after 8:00 PM are skipped
View generated trips and their GNSS points on a full-screen map.
- No credit card required - Free tier with email signup only
- No data storage restrictions - Generated GNSS data can be freely stored and used
- Based on OpenStreetMap - Open data, no licensing concerns
- Generous free tier - 2,000 requests/day (~60,000/month)
- Go to openrouteservice.org
- Sign up with email (free)
- Verify email
- Go to Dashboard → Tokens
- Create a new token
- Enter the token in Settings page
| Service | Free Tier | Notes |
|---|---|---|
| OpenRouteService | 2,000 req/day | No credit card |
| Leaflet + OSM Tiles | Unlimited | Free, open source |
Map Display:
- Uses Leaflet.js with CartoDB Dark tiles (based on OpenStreetMap)
- No API key required for map display
- Dark theme matching the app design
| Field | Type | Description |
|---|---|---|
| id | bigint | Auto-generated |
| device_timestamp | timestamp | Device time |
| positioning_timestamp | timestamp | GPS fix time |
| imei | bigint | Device IMEI |
| gps_status | varchar | "VALID" or "LOW_ACCURACY" |
| latitude | double | -90 to 90 |
| longitude | double | -180 to 180 |
| altitude | double | Meters |
| speed | double | km/h |
| direction | double | 0-360 degrees |
| authentication_status | integer | Authentication status |
| base_info | varchar | Base info |
| hdop | double | Horizontal dilution |
| lte_rssi | integer | LTE signal strength |
| mmri_* | double | MMRI related fields |
| cellular_* | various | Cellular positioning data |
| ekf_* | double | EKF positioning data |
| fw_version | varchar | Firmware version |
| delete_flag | boolean | Soft delete |
| Field | Type | Description |
|---|---|---|
| id | Integer | Auto-generated |
| vehicle_id | bigint | Vehicle reference |
| imei | bigint | Device IMEI |
| origin_lat/lng | Float | Start coordinates |
| origin_name | String | Start location name |
| destination_lat/lng | Float | End coordinates |
| destination_name | String | End location name |
| distance_meters | Integer | Route distance |
| start_time | ISO String | Trip start |
| end_time | ISO String | Trip end |
| point_count | Integer | GNSS point count |
| settings | Object | Generation parameters |
All data exports to CSV format compatible with database import.
Export Options:
- Dashboard: Export all data (all tables)
- Individual Screens: Export specific entity data
- Trip Viewer: Export trips + GNSS points
- Master Data: CSV import on each management screen
- Geofences: Bulk import with GeoJSON polygon data
All sample files are located in data/sample/:
| File | Records | Description |
|---|---|---|
sample_offices.csv |
6 | HQ, branches, warehouses in Tokyo/Nagoya/Osaka |
sample_devices.csv |
10 | Tracking devices (7 active, 3 spare) |
sample_vehicles.csv |
10 | Trucks, EV, Hybrid, LPG vehicles |
sample_deployments.csv |
7 | Device-to-vehicle mappings |
sample_geofences.csv |
63 | Ward offices (Tokyo 23, Nagoya 16, Osaka 24) |
Import these files in order to quickly set up a working environment.
- Recommended: Chrome (latest)
- Supported: Edge, Firefox, Safari
- Required: IndexedDB support
- All data stored in browser's IndexedDB
- Data persists across sessions
- Clear browser data will delete all app data
- Use Export function for backup
This application uses:
- OpenRouteService - Routing API
- OpenStreetMap - Map data
- CARTO - Map tiles (CartoDB Dark Matter)
- Leaflet - Map library