Skip to main content
Solved

Problem with spatial relations


Forum|alt.badge.img

Hello,

I need to merge attributes of polygon to polyline that contains that polyline (polygon can contain whole polyline or just one part of it) I am using SpatialRelator with test Requestor contains Supplier as shown in image below.

Problem i have is that this test merges attributes from polygons that only contains start point of polyline. Is there any other way to merge these two features?

 

In case that polyline goes over more than one polygon it's enough to merge attributes from any of containing polygons.

Blue line is polyline. With SpatialRelator polyline gets attributes of polygon 2353 but it needs to get attributes of polygon 28 or 30.

Best answer by markatsafe

@luckm There is a pretty good description of the spatial predicates buried in the documentation under Spatial Relations Defined (links are on the SpatialRelator and SpatialFilter transformer docs.). This should help you understand the different spatial interactions. "Crosses" looks like the most appropriate predicate, as @gio suggests.

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

5 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 4, 2018

@luckym

Spatialrelator relates; it doe not intersect. So in your example, no polygon actually contain the polyline.

You can use "intersect"

Or you can reverse the inputs and test for "crosses".

Also you can use calculate cardinality, listconcatenate "relationsships.card_line" with no delimiter and and test for it to be >0.

Use list to get all polygon_id's that are crossed by the polyline.

Of course you can also intersect or do lineOnArea and relator.


Forum|alt.badge.img+2
  • Best Answer
  • July 4, 2018

@luckm There is a pretty good description of the spatial predicates buried in the documentation under Spatial Relations Defined (links are on the SpatialRelator and SpatialFilter transformer docs.). This should help you understand the different spatial interactions. "Crosses" looks like the most appropriate predicate, as @gio suggests.


Forum|alt.badge.img
  • Author
  • July 5, 2018
@gio

The test i used in my actual workbench is intersects I made a mistake when i posted a problem. And that test gives me results above. I would use crosses as you and @MarkAtSafe suggest but I don't have it

Maybe I'm doing something wrong or maybe test crosses is reserved for non-trial versions of FME?


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 5, 2018

@luckym

Hi,

Crosses appears when you set Support Mode to "Support All Predicates"


Forum|alt.badge.img
  • Author
  • July 5, 2018
@gio

Thank you. This works very well. @MarkAtSafe thank you too.


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