1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user