I imported ~ 1000 paths from somewhere to my postgis database in the linestring field.
( EDIT ) My table is similar to
+---------+---------------+------------------+
| id(int) | name(varchar) | path(LINESTRING) |
+---------+---------------+------------------+
| 123 | foo | 000002... |
| 124 | bar | 000002... |
I had a problem that each of the paths was divided into pieces, and in some cases these pieces were involved.
Suppose a line with a line separated at points 50 and 70:
- Chunk A: Points 1-50
- Part B: Points 51-70
- Chunk C: points 71-100
When I transferred this to my database, they were mixed, so the given linestring could end up as follows:
- Chunk A: Points 1-50
- Chunk C: points 71-100
- Part B: Points 51-70
Thus, a jump from 50 to 71 is obtained, and the other from 100 to 51
(EDIT). , , , , , , linestrings , .
, (), SQL-, , , ( , openlayers) .
SQL , , ( , 5% )
EDIT3. , script , . , SQL, , , .
, max ?
:

,

EDIT4. EDIT3, , , ST_NPoints() ST_PointN(), . , , , . , .
SQL :
|ordered by this|
+---------+---------------+------------------+---------------+
| id(int) | name(varchar) | path(LINESTRING) | msbtcp(int) |
+---------+---------------+------------------+---------------+
| 123 | foo | 000002... | 1000 |
| 124 | bar | 000002... | 800 |
* msbtcp : max_separation_between_two_consecutive_points(path)