I'm quite new to using proper spatial tools, and have a simple question that doesn't immediately show up on google.
I have a table that contains multiple rows of empiric data (say, speed of a vehicle) that also has spatial information connected to it. Every speed measure (real number) has a linestring geometry to it.
Many of those Linestrings are touching each other on the end points.
My task is to:
- visualize all groups of touching lines as separate multilines
- simplify each of the resulting multilines to reduce the amount of points and consequently data to be displayed (i.e. when we "zoom out", so I need configurable loss of precision)
- aggregate average speed for every segment in each simplified multiline
Now, I understand that spatial simplification and scalar aggregation probably use different algorithms, but what's the common approach to this?
Here's some data:
geom |speed LINESTRING(25.51369 65.01514, 25.51362 65.01521) |21.6324731983004 LINESTRING(25.51362 65.01521, 25.51369 65.01514) |20.7681850053341 LINESTRING(24.95117 60.1898, 24.95112 60.18981) |15.5648781827192 LINESTRING(24.8263 60.20353, 24.82685 60.2035) |19.7643783824494 LINESTRING(24.82685 60.2035, 24.8263 60.20353) |15.2009950253671
I have understood that
ST_Simplify() can take care of building a joined multiline and reducing its complexity.
Part 3 of the task still stands: how do I calculate average speed values for various parts of the newly created and simplified multiline?