我有幾條相同路線的視頻軌道,全年在不同的場合拍攝。所有的視頻軌道都帶有GPS標籤,帶有1Hz的GPS,所以我有所有鏡頭的秒針。PostGIS:通過GPS同步時間碼點
我想完成的是將所有這些視頻軌道放入例如After Effects後,通過GPS位置重新映射時間。我無法按時間同步軌道,因爲路線包括紅綠燈和其他障礙物。
我已經開始創建兩個表格:一個叫夏天,這是主要的視頻軌道,另一個叫鏡頭,它包含所有其他的鏡頭。
夏天表看起來像這樣:
Column | Type | Modifiers | Storage | Description
-----------+------------------------+--------------------------------------------------------------------+---------+-------------
id | integer | not null default nextval('summer_id_seq'::regclass) | plain |
timecode | time without time zone | not null | plain |
spring_id | integer | | plain |
autumn_id | integer | | plain |
winter_id | integer | | plain |
point | geometry(Point,4326) | not null | main |
Indexes:
"summer_pkey" PRIMARY KEY, btree (id)
"summer_autumn_id" btree (autumn_id)
"summer_point_id" gist (point)
"summer_spring_id" btree (spring_id)
"summer_winter_id" btree (winter_id)
Foreign-key constraints:
"summer_autumn_id_fkey" FOREIGN KEY (autumn_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
"summer_spring_id_fkey" FOREIGN KEY (spring_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
"summer_winter_id_fkey" FOREIGN KEY (winter_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
Has OIDs: no
雖然出手表看起來像這樣:
Column | Type | Modifiers | Storage | Description
----------+------------------------+-------------------------------------------------------------------+----------+-------------
id | integer | not null default nextval('shot_id_seq'::regclass) | plain |
season | character varying(255) | not null | extended |
timecode | time without time zone | not null | plain |
point | geometry(Point,4326) | not null | main |
Indexes:
"shot_pkey" PRIMARY KEY, btree (id)
"shot_point_id" gist (point)
Referenced by:
TABLE "summer" CONSTRAINT "summer_autumn_id_fkey" FOREIGN KEY (autumn_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
TABLE "summer" CONSTRAINT "summer_spring_id_fkey" FOREIGN KEY (spring_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
TABLE "summer" CONSTRAINT "summer_winter_id_fkey" FOREIGN KEY (winter_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
Has OIDs: no
所以,基本上我想要做的,是通過所有的行運行在夏季表中,查找每個不同拍攝的最接近每一行的點,並使用此信息更新夏季表。
我已經把一個查詢,我個人不明白爲什麼不工作,但輸出是怪異,並且不隨時間重映射在After Effects在所有的工作:
SELECT DISTINCT ON (summer.id)
summer.id AS summer_id, shot.id AS autumn_id,
ST_Distance_Sphere(summer.point, shot.point) AS distance
FROM shot.summer summer
LEFT JOIN shot.shot.track
ON ST_DFullyWithin (summer.point, shot.point, 0.001)
AND shot.season='autumn'
ORDER BY summer.id ASC;
有人能指引我走向正確的方向嗎?
謝謝!