2

Is there a function like ST_Line_Interpolate_Point but using a multilinestring?

3
  • 2
    You mean a linestring wrapped in a multilinestring or a true multiline. What does a percentage mean when a multilinestring is not connected? If you have connected multlinestrings then you can use ST_LineMerge to merge into one linestring – LR1234567 Aug 18 '14 at 18:20
  • I mean in a multiline that is conected, and I want to search a random percentage in the multiline. – user2898914 Aug 19 '14 at 7:36
  • 1
    What if the multilines are connected in a Y-shape? Short answer: no, there isn't one for multilinestring, because the semantics of it make limited sense. – Paul Ramsey Aug 19 '14 at 19:06
1

I fix it, just have to use first of all the function st_linemerge, then use the function st_makeline and finally use ST_line_interpolate_point.

ST_line_interpolate_point(st_makeline(st_linemerge(geom)),fraction);
1
  • Note that ST_LineMerge will only merge the lines in a multi-linestring if end and start point of two consecutive lines are at the same position. See also the examples in the documentation: postgis.net/docs/ST_LineMerge.html – tsauerwein Mar 9 '16 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.