Skip to main content
Question

line crossing a polygon

  • December 11, 2019
  • 2 replies
  • 129 views

Forum|alt.badge.img

Hi,

I have a dataset of lines (from one lat/long to another lat/long).

 

I also have various polygons from an online dataset. I want to find out where the line crosses a polygon and then it the flag 'True'.

 

My guess is to use spatialrelator, but not sure what parameters to set.

 

My line is the requestor, and I believe my polygons should be the supplier. However, not sure what to select as the 'spatial predicates to test'. Or if I even use this method at all.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

SpatialRelator is the way to go. Here's some examples of the spatial relations: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/spatialrelations.htm, I'd say "crosses" is the one to try.


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • December 11, 2019

Yes, look at SpatialRelator and the provided help for it as per what @redgeographics suggests. Just to slightly fix up the posted link (there was an inadvertant "," in it), it is:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/spatialrelations.htm

Notes: "Crosses" are for where the line intersects a Polygon, but does not touch it. Ie. The line has to cross beyond the boundary of the polygon in order for this to be true. If the line only runs along the boundary, or intersects only with an edge vertex, then this will be evaluated as false.

If instead you want to test if the line touches or crosses the polygon, then this is what "Intersects" will do, or both conditions can be tested separately with "Crosses" and "Touches"


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