Skip to main content
Question

Extract part of polygons


hi,

 

 

i have two shp. in one shp are polygons, and the second shp contain line. this lines need to be closed with polygons in first shp. how to find parts of these polygons which closed lines? i try with neighbor finder , but don't give right result.

 

26 replies

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 17, 2013
Hi,

 

 

The Area port of the LineOnAreaOverlayer will supply you with the areas that contain lines attributes.

 

 

Is this what you mean by closed?

  • Author
  • December 17, 2013
in original file, polygons in first shape is also line, but closed.. i'am that line with area builder transform in polygons.

 

i attach example.... polygons are white, green line is line from second shp,

 

and i need to get red line..

 

 

http://www.filedropper.com/example_2

  • Author
  • December 17, 2013
few more examples...maybe somehow with shortes path? http://www.filedropper.com/pic

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 17, 2013
OK, Have you tried the LineOnAreaOverlayer? also the SpatialRelator with the proper test can  provide the desired results.

 

 

Itay

  • Author
  • December 17, 2013
i tried LineOnArea Overlayer, and i get exactly the same line like green..

 


fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 17, 2013
The SpatialRelator with touches seems like what you want.

  • Author
  • December 17, 2013
i used chopper to create every vertex point of green line, and point od line overlay to get intersected lines. than i used spatial relator, base is intersected lines, and candidate green lines, test to perform Touches, but i dont know how to test to get the required lines..can you help me, please..tnx

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 17, 2013
download this demo fmw it shows how to test for a line that touches an area

  • Author
  • December 17, 2013
tnx, but i have fme 2012, and i can't open this..can you save it in 2012, please?

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 17, 2013
cant, what do you see when you open it? its basically 2 creators and a SpatialRelator, you can replace the SpatialRelator with a 2012 one...

  • Author
  • December 17, 2013
ok, i do that.. I thought there still some test that filters the lines that  i need, but I get the same lines as those  white. nothing was happening.

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 17, 2013
true test for the lines with a relationship....

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • December 17, 2013
Hi,

 

 

Whether a polyline or an area doesnt matter if u do this.

 

 

 

Use intersector.

 

Then use a spatialrelator, enter output from intersector line into both inputs to SpatialRelator. Set calculate cardinality to yes.

 

 

Expose cardinality (relationships{}.card_line). U have to use a AttributeExposer for this, as it is a hidden attribute, you cannot select it from a roll-down menu..alas). (index 0 willd do unless more then 2 objects intersect)

 

Then use tester to test on related_candidates>1 and card_line=1

 

 

U should now have your intersections.

  • Author
  • December 18, 2013
Hi Gio,

 

tnx for answer. i do all this, but from tester doesn't come out anything from passed port. does and node from intersector goes to spatial relator?

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 18, 2013
If you are interested in the nodes then yes, but I guess you are not, so just feed the lines into the SpatialRelator.

 

The expression related_candidates>1 and card_line=1 for the tester will not result in the line you are interested in, since all card_line are equal to 0.

 

 

You can skip the SpatialRelator and test the lines resulting from the Intersector for _overlaps =2

 

 

Itay

  • Author
  • December 18, 2013
i do that...but i got line between two neighboring white polygon, not a line between the white polygon and green line. Is it even possible? i really do not know what to do

  • Author
  • December 18, 2013
green lines doesnt share a line with white polygons at all. they are just snaped to them.

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 18, 2013
then you should consider a different approach, something like a minimal distance of lines to polygons.

  • Author
  • December 18, 2013
I thought that shortest path would be right approach, but i dont know how to calculate the parameters

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 18, 2013
Have a look at the NeighborFinder and NeighborPairFinder, in there you can specify a maximum search distance.

takashi
Influencer
  • December 18, 2013
Hi,

 

 

This example might be also helpful. Using the Clipper transformes. http://www.pragmatica.jp/fmepedia/131218WorkspaceExample.zip

 

 

Takashi

  • Author
  • December 18, 2013
hi,

 

why did you create the middle point of the line? i can't get all required line, only 10% of them.

takashi
Influencer
  • December 18, 2013
The Intersector and the AreaBuilder will create every area including the original polygons. The middle points are used for selecting only areas inside of green lines with the SpatialFilter.   The example assumes that every end node of green line touches or intersects with polygon. If there are exceptional conditions e.g. small gap between end node of green line and polygon, the Intersector will not work expectedly.

 

Using the Inspector, check whether the result of each step is good.

  • Author
  • December 18, 2013
i think that Intersector works fine, and that is problem in spatial filter where i get only 606 records.. i I checked, green line is snaped to polygons..i attach you screenshot Inspector with result, and microstation original file. can you check?

 

 

http://www.filedropper.com/extractpart

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • December 18, 2013
Hi,

 

 

This can be a cse of decimal rounding, have you tried rounding the decimals of the coordinates before the spatial test?

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