This commit is contained in:
Hamza-Ayed
2026-03-20 02:14:50 +03:00
parent 65ce6a0ba2
commit 6e6ee55d03
47 changed files with 14706 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { Entity, Column, PrimaryColumn, Index } from 'typeorm';
@Entity('road_segment_stats')
export class RoadSegmentStat {
@PrimaryColumn()
segmentId: string; // OSM Way ID or similar
@Column('float', { default: 0 })
averageSpeed: number;
@Column('float', { default: 1.0 })
congestionFactor: number; // 1.0 = Free flow, >1.0 = Congested
@Column('int', { default: 0 })
sampleCount: number;
@Column({
type: 'geography',
spatialFeatureType: 'LineString',
srid: 4326,
nullable: true,
})
@Index({ spatial: true })
geometry: any;
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
lastUpdated: Date;
}