stable: finalized GIS aesthetics and Syria/Jordan routing synchronization

This commit is contained in:
Hamza-Ayed
2026-03-28 04:12:01 +03:00
parent d6f3b41b53
commit 592af8ce5c
203 changed files with 9711 additions and 119 deletions
@@ -0,0 +1,60 @@
import { Entity, Column, PrimaryGeneratedColumn, Index, CreateDateColumn } from 'typeorm';
/**
* Candidate Road Entity - طرق مرشحة مكتشفة من بيانات التتبع
*
* Stores potential new roads discovered from telemetry data where
* multiple drivers traveled off-road in a consistent linear pattern.
*/
@Entity('candidate_roads')
export class CandidateRoad {
@PrimaryGeneratedColumn('uuid')
id: string;
// GeoJSON LineString representing the discovered road path
// خط يمثل المسار المكتشف
@Column({
type: 'geography',
spatialFeatureType: 'LineString',
srid: 4326,
nullable: false,
})
@Index({ spatial: true })
geometry: any;
// Number of unique drivers who used this path
// عدد السائقين الفريدين الذين استخدموا هذا المسار
@Column('int', { default: 0 })
uniqueDriverCount: number;
// Total telemetry points that contributed to this candidate
// عدد النقاط الإجمالي المساهم في اكتشاف هذا المسار
@Column('int', { default: 0 })
totalPoints: number;
// Average speed observed on this candidate road (km/h)
// متوسط السرعة المسجلة (كم/ساعة)
@Column('float', { default: 0 })
averageSpeed: number;
// Estimated length in meters
// الطول التقريبي بالمتر
@Column('float', { default: 0 })
lengthMeters: number;
// Confidence score (0-1): higher = more likely a real road
// درجة الثقة (0-1): كلما زادت كلما كان احتمال كونها طريق حقيقي أعلى
@Column('float', { default: 0 })
confidence: number;
// Review status: 'pending', 'approved', 'rejected'
// حالة المراجعة: pending=بانتظار المراجعة، approved=تمت الموافقة، rejected=مرفوض
@Column({ default: 'pending' })
status: string;
@CreateDateColumn()
discoveredAt: Date;
@Column({ type: 'timestamp', nullable: true })
reviewedAt: Date;
}
+3 -1
View File
@@ -1,9 +1,11 @@
import { Controller, Get, Query } from '@nestjs/common';
import { Controller, Get, Query, UseGuards } from '@nestjs/common';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { MapsService } from './maps.service';
import { ApiKeyGuard } from '../common/guards/api-key.guard';
@ApiTags('maps')
@Controller('maps')
@UseGuards(ApiKeyGuard)
export class MapsController {
constructor(private readonly mapsService: MapsService) {}
+6 -1
View File
@@ -3,9 +3,14 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import { MapsService } from './maps.service';
import { MapsController } from './maps.controller';
import { RoadSegmentStat } from './road-stat.entity';
import { CandidateRoad } from './candidate-road.entity';
import { RedisModule } from '../common/redis.module';
@Module({
imports: [TypeOrmModule.forFeature([RoadSegmentStat])],
imports: [
TypeOrmModule.forFeature([RoadSegmentStat, CandidateRoad]),
RedisModule,
],
controllers: [MapsController],
providers: [MapsService],
exports: [MapsService],