Skip to main content
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.

 

Hi,

 

 

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

 

 

Is this what you mean by closed?
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
few more examples...maybe somehow with shortes path? http://www.filedropper.com/pic
OK, Have you tried the LineOnAreaOverlayer? also the SpatialRelator with the proper test can  provide the desired results.

 

 

Itay
i tried LineOnArea Overlayer, and i get exactly the same line like green..

 


The SpatialRelator with touches seems like what you want.
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
download this demo fmw it shows how to test for a line that touches an area
tnx, but i have fme 2012, and i can't open this..can you save it in 2012, please?
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...
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.
true test for the lines with a relationship....
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.
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?
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
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
green lines doesnt share a line with white polygons at all. they are just snaped to them.
then you should consider a different approach, something like a minimal distance of lines to polygons.
I thought that shortest path would be right approach, but i dont know how to calculate the parameters
Have a look at the NeighborFinder and NeighborPairFinder, in there you can specify a maximum search distance.
Hi,

 

 

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

 

 

Takashi
hi,

 

why did you create the middle point of the line? i can't get all required line, only 10% of them.
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.
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
Hi,

 

 

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

Reply