I have a table with latitude, longitude representing paths. I want to simplify the paths using Postgis ST_Simplify
Here is a sample set of 89 GPS points i try to simplify : https://gist.github.com/vdaubry/ab57027d8100495bdf261478808a8a50
I expect the result to be a smaller list of GPS points representing a similar shaped path.
When i run ST_Simplify on this set i only get 2 points as a result.
Can you help me debug this query ?
SELECT ST_X((result.points).geom) AS latitude, ST_Y((result.points).geom) AS longitude
FROM (
SELECT ST_DumpPoints(simplified_path.simplifiedLine) AS points
FROM (
SELECT ST_Simplify(ST_MakeLine(path.point), 3) as simplifiedLine
FROM (
SELECT ST_SetSRID(ST_MakePoint(latitude, longitude),4326) AS point
FROM tour_points
where tour_id=369
ORDER BY passing_time ASC
) as path
) simplified_path
) result
P.S: I tried playing with the tolerance parameter but i always end up with only 2 points.