答案 0 :(得分:0)
您是否只需要每个轨迹ID的LineString(意味着通过'找到类似的轨迹')?如果是这样,您希望将ST_MakeLine(空间聚合版本)与ST_MakePoint结合使用。对于PostGIS 9.0及更高版本,您可以执行以下操作:
SELECT points.trackid,
ST_MakeLine(points.point_geom ORDER BY points.timedetails) AS line_geom
FROM (SELECT data.trackid,
data.timedetails,
ST_MakePoint(data.longitude, data.latitude) AS point_geom
FROM your_table AS data) AS points
GROUP BY points.trackid;