Changes between Version 1 and Version 2 of AdvancedConcepts


Ignore:
Timestamp:
06/15/26 19:14:25 (33 hours ago)
Author:
231119
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedConcepts

    v1 v2  
    1 Advanced Concepts
     1== Advanced Concepts
     2
     3Во оваа фаза од проектот, стандардниот релационен модел е надограден со просторни функционалности преку екстензијата PostGIS. Дополнително, за следење на возилата е имплементирана Lambda архитектура (Hot/Cold складирање) со 4D просторно-временски траектории (LineStringZM).
     4
     51. Иницијализација на PostGIS и конверзија во полигони (Geofencing)
     6Првиот чекор вклучува овозможување на PostGIS екстензијата и мигрирање на постоечките координати во geometry објекти. Дополнителна промена е отфрлањето на обичните радиуси за зоните на компаниите. Наместо тоа, користејќи ја функцијата ST_Buffer, кружните области се конвертирани во прецизни полигони со што се овозможува вистинско дигитално надградување. Креирани се и GiST (Generalized Search Tree) индекси кои се потребни за брзо пребарување на просторни податоци.
     7
     8{{{
     9create extension if not exists postgis schema public;
     10
     11alter table driver add column location geometry(Point, 4326);
     12
     13update driver
     14set location = st_setsrid(st_makepoint(longitude, latitude), 4326);
     15
     16alter table request add column start_location geometry(Point, 4326);
     17
     18alter table request add column end_location geometry(Point, 4326);
     19
     20update request
     21set start_location = st_setsrid(st_makepoint(start_longitude, start_latitude), 4326);
     22
     23update request
     24set end_location = st_setsrid(st_makepoint(end_longitude, end_latitude), 4326);
     25
     26alter table waypoints add column location geometry(Point, 4326);
     27
     28update waypoints
     29set location = st_setsrid(st_makepoint(longitude, latitude), 4326);
     30
     31alter table location add column location geometry(Point, 4326);
     32
     33update location
     34set location = st_setsrid(st_makepoint(longitude, latitude), 4326);
     35
     36alter table report add column location geometry(Point, 4326);
     37
     38update report
     39set location = st_setsrid(st_makepoint(longitude, latitude), 4326);
     40
     41alter table area add column coverage_polygon geometry(Polygon, 4326);
     42
     43update area
     44set coverage_polygon = ST_Buffer(
     45    ST_SetSRID(ST_MakePoint(longitude, latitude), 4326)::geography,
     46    radius
     47)::geometry;
     48
     49create index idx_area_coverage_polygon on area using gist (coverage_polygon);
     50
     51}}}