Given a trajectory as a sequence of GPS points I would like to create a smooth linestring representing a path where a car drove. The data is stored in postgresql: the input trajectory in a table, where each row represents an individual GPS point, the output in a table, where each row represents the whole smooth tragectory. All points are stored in WGS84.
My approach for this would be the following:
- implement everything in C++
- retrieve the whole trajectory from the DB, convert it to UTM32N (as this is where the trajectories are coming from), flatten the points with the help of GDAL library
- compute a some sort of approximate spline
- linearize the approximate spline
- transform it back to WGS84
- send the data back to Postgres
What would be the best tools/libraries to use for approximate splines and linearization?
Java/C++/Postgis solutions are preferable, as currently we are using only these subsystems.
I suppose this is a very common task people need to do in gis environment, however I haven't found close matches to similar questions on gis stackexchange.
An alternative would be to:
- collect all points into linestring
- apply Bezier smoothening to the curve