Skip to main content
Solved

separating lines (shp)


Forum|alt.badge.img

Hi,

I have a set of lines that make up a set of polygons. Is there a way to separate lines that goes around the edge of data set? (see picture below, only yellow lines)

Thank you.

Best answer by david_r

Thanks for the feedback, didn't realize you needed to preserve the input lines. Try this:

getperimeter.fmwt

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

15 replies

david_r
Celebrity
  • July 16, 2018

One way could be to try the AreaBuilder followed by the Dissolver and then the GeometryCoercer set to fme_line.


Forum|alt.badge.img
  • Author
  • July 16, 2018
david_r wrote:

One way could be to try the AreaBuilder followed by the Dissolver and then the GeometryCoercer set to fme_line.

Perfect. That do the trick. Thank you @david_r.

 


Forum|alt.badge.img
  • Author
  • July 16, 2018

Sorry, @david_r it only gave me one line. I need all the lines that make that one big polygon.


david_r
Celebrity
  • July 16, 2018

The result will depend on how accurately the lines are connecting, the should be 100% topologically correct for this to work. You may want to try a Snapper (segment snapping) with a small tolerance as well as an Intersector before the AreaBuilder, if necessary.

If that doesn't work, consider posting a small ffs-file here with some sample data so that we can give a more tailored response.


oscard
Influencer
Forum|alt.badge.img+21
  • Influencer
  • July 16, 2018
Does this come from a CAD source? If you want the yellow lines you could perform a filter using the color attribute.

 

 


Forum|alt.badge.img
  • Author
  • July 16, 2018
david_r wrote:

The result will depend on how accurately the lines are connecting, the should be 100% topologically correct for this to work. You may want to try a Snapper (segment snapping) with a small tolerance as well as an Intersector before the AreaBuilder, if necessary.

If that doesn't work, consider posting a small ffs-file here with some sample data so that we can give a more tailored response.

Lines are snapped I tried adding Snapper with small tolerance and all the lines outputs as Untouched. I will upload some data. testdata.zip

 

 


Forum|alt.badge.img
  • Author
  • July 16, 2018
oscard wrote:
Does this come from a CAD source? If you want the yellow lines you could perform a filter using the color attribute.

 

 

Unfortunately all the lines are the same color. I changed it to showcase what I need because English is not my native language and sometimes people doesn't understand me at first. Thank you for your input @oscard

 


david_r
Celebrity
  • July 16, 2018

Seems to work fine for me:

Input:

Output:

Here's the workspace (FME 2017.1.2.1):

getperimeter.fmwt


Forum|alt.badge.img
  • Author
  • July 16, 2018
david_r wrote:

Seems to work fine for me:

Input:

Output:

Here's the workspace (FME 2017.1.2.1):

getperimeter.fmwt

I get that too but it is only one line or polygon for me. I need to get lines that make that polygon.

 

 

 

 

In table view i need to get 100+ rows that represent lines. With this I only have one.

david_r
Celebrity
  • Best Answer
  • July 16, 2018

Thanks for the feedback, didn't realize you needed to preserve the input lines. Try this:

getperimeter.fmwt


Forum|alt.badge.img
  • Author
  • July 16, 2018
david_r wrote:

Thanks for the feedback, didn't realize you needed to preserve the input lines. Try this:

getperimeter.fmwt

This is the one. Thank you @david_r and sorry for misunderstanding.

 


takashi
Evangelist
  • July 16, 2018
david_r wrote:

Thanks for the feedback, didn't realize you needed to preserve the input lines. Try this:

getperimeter.fmwt

The SpatialFilter can also be used instead of the LineOnLineOverlayer + Tester.

 

  • GeometyCorecer -> Filter
  • Original Line Features -> Candidate
  • Spatial Predicates to Test: "Filter Contains Candidate"

 

Another approach.

 

 

 


fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • July 16, 2018

Hi @luckym You could also use just a TopologyBuilder after the AreaBuilder. The Universe feature will be a polygon of the outer edges.


Forum|alt.badge.img
  • Author
  • July 17, 2018
fmelizard wrote:

Hi @luckym You could also use just a TopologyBuilder after the AreaBuilder. The Universe feature will be a polygon of the outer edges.

Yes it gave the largest polygon but in my case i needed the lines that make that polygon. Accepted answer gave mi that. Thank you for your input @DanAtSafe it may help someone in the future.

 


Forum|alt.badge.img
  • Author
  • July 17, 2018
takashi wrote:
The SpatialFilter can also be used instead of the LineOnLineOverlayer + Tester.

 

  • GeometyCorecer -> Filter
  • Original Line Features -> Candidate
  • Spatial Predicates to Test: "Filter Contains Candidate"

 

Another approach.

 

 

 

Yes, this is another approach. Thank you @takashi.

 


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