Skip to main content
Solved

Multiline string to Linestring


Forum|alt.badge.img

Hello,

I have lines (linestring) that intersect forming Multilinestring. I would like to know if it possible to "force" them to keep the Linestring format?

Example: here is a network with a loop (in red)

imageOn FME, I tried a deagregator which gives me 3 polylines , 3 linestring. Ok it's good! But I want juste one line and impossible for me to find how to merge these 3 lines without convert all in Multilinestring.

I tried the LineCombiner but nothing happens, I still had my 3 lines.imageAny help would be appreciated :)

Thanks you

Best answer by panda

nielsgerrits wrote:

In the linecombiner, you group by the attribute idchemin, so all 3 lines have the same attribute? Just checking. Can you upload an FFS with the 3 lines? Difficult to say what is wrong from printscreens.

single-line@kael112 I finally got it drawn correctly yay! However, I have not quite figured out how to make this dynamic. I have to manually rearrange the part number to get this to work. I have attached fme workspace with annotations to help explain what I did. Please let me know if you figure out how to make it dynamic!

View original
Did this help you find an answer to your question?

14 replies

nielsgerrits
VIP

If the vertices of the endpoints of the lines are not on exactly the same location, the LineCombiner will not connect them. You can try to fix this using the Snapper transformer upstream of the LineCombiner.


Forum|alt.badge.img
  • Author
  • December 7, 2023

great Idea but the problem still here!

image


nielsgerrits
VIP
kael112 wrote:

great Idea but the problem still here!

image

In the linecombiner, you group by the attribute idchemin, so all 3 lines have the same attribute? Just checking. Can you upload an FFS with the 3 lines? Difficult to say what is wrong from printscreens.


Forum|alt.badge.img
  • Author
  • December 8, 2023
nielsgerrits wrote:

In the linecombiner, you group by the attribute idchemin, so all 3 lines have the same attribute? Just checking. Can you upload an FFS with the 3 lines? Difficult to say what is wrong from printscreens.

Yes it's the same.

I uploaded a FFS, thank you for your help


nielsgerrits
VIP
nielsgerrits wrote:

In the linecombiner, you group by the attribute idchemin, so all 3 lines have the same attribute? Just checking. Can you upload an FFS with the 3 lines? Difficult to say what is wrong from printscreens.

I now better understand your issue. The line is self intersecting, creating 3 parts due to the self intersect. I do not have a solution now but someone else probably has.

 

2023-12-08_09h33_52


Forum|alt.badge.img
  • Author
  • December 11, 2023
nielsgerrits wrote:

In the linecombiner, you group by the attribute idchemin, so all 3 lines have the same attribute? Just checking. Can you upload an FFS with the 3 lines? Difficult to say what is wrong from printscreens.

Yes the self intersecting create 3 parts. I Would like to know if it's possible to "force" the line ,don't create the 3 parts, still have just one line?

If somebody has an idea ... 😊


panda
Enthusiast
Forum|alt.badge.img+17
  • Enthusiast
  • Best Answer
  • December 15, 2023
nielsgerrits wrote:

In the linecombiner, you group by the attribute idchemin, so all 3 lines have the same attribute? Just checking. Can you upload an FFS with the 3 lines? Difficult to say what is wrong from printscreens.

single-line@kael112 I finally got it drawn correctly yay! However, I have not quite figured out how to make this dynamic. I have to manually rearrange the part number to get this to work. I have attached fme workspace with annotations to help explain what I did. Please let me know if you figure out how to make it dynamic!


Forum|alt.badge.img
  • Author
  • December 19, 2023
nielsgerrits wrote:

In the linecombiner, you group by the attribute idchemin, so all 3 lines have the same attribute? Just checking. Can you upload an FFS with the 3 lines? Difficult to say what is wrong from printscreens.

Thank you @panda​ , it works!


Forum|alt.badge.img
  • Author
  • January 8, 2024

@panda​ 

your script works fine in a one way but how to do in a round trip. I tried and this is the result

imageimageDo You know a way to do this?

thank you


panda
Enthusiast
Forum|alt.badge.img+17
  • Enthusiast
  • January 8, 2024
kael112 wrote:

@panda​ 

your script works fine in a one way but how to do in a round trip. I tried and this is the result

imageimageDo You know a way to do this?

thank you

Do you mind provide me the .ffs for those feature please.


Forum|alt.badge.img
  • Author
  • January 9, 2024
panda wrote:

Do you mind provide me the .ffs for those feature please.

Here you will find a line which is in fact two compiled lines (the forward and the return)

Thank you for your help


panda
Enthusiast
Forum|alt.badge.img+17
  • Enthusiast
  • January 9, 2024
panda wrote:

Do you mind provide me the .ffs for those feature please.

So I personally never deal with road network before. The way I do it may be wrong. But I think the issue is at this location.OriginalIntersectI'm wondering if you can fix these verticies manually. I'm not quite sure how to remove some of these verticies in FME without spend couple more hours on it. I remove some of the verticies in the middle and move each of the line end vertex to make it connect without intersect each other. I'm not sure if this is the acceptable way to make road network. But this way it fixed the multipart line and turn it into single line with the same exact workspace i provided before.

intersect


Forum|alt.badge.img
  • Author
  • January 10, 2024
panda wrote:

Do you mind provide me the .ffs for those feature please.

I'm agree with you, it requests hours and manuel work to get a perfect network.

Thank for your help.


panda
Enthusiast
Forum|alt.badge.img+17
  • Enthusiast
  • January 10, 2024
panda wrote:

Do you mind provide me the .ffs for those feature please.

Let me know if the way I fix it is how it is supposed to be? When I have free time, I'll work on this. I imagine I will eventually run into this issue at some point.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings