Skip to main content
Question

How to find points and lines that cannot fulfill certain criteria


Forum|alt.badge.img

1Hello there,

 

So I have bunch of points and lines in my database. For the final output, I would like to extract the points/line (possibly the name) that cannot fullfill the following criteria.

 

1) The points MUST touch the lines, but it can have a tolerance of 1m to the closest lines.

2) The starting and ending of the lines MUST have points.

 

So the sample shows that points 1-6 are correct, while the points 7-9 and the line below (C) are not correct. It is because the line C does not have the starting and ending points. Also, the points 7-9 do not contain lines within 1m buffer.

Might I ask what kind of transformers I can use?

 

I am not very good at FME and hopefully someone can give me a hand.

Thank you very much.

 

Zach

4 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • October 20, 2021

To check if there are points for start and end points of the line:

Create Xpoint and Ypoint attributes for the points (AttributeCreator Xpoint=@XValue, Ypoint=@YValue)

Use GeometryExtractor on the lines (it will come in handy later), use two CoordinateExtractor transformers on the lines in parallel configured as Specify Coordinates, one with 0 (start point) an one with -1 (end point) followed by VertexCreators set to Replace with Points. Buffer them to 1m and send them to the Requestor port of SpatialRelator and send points to the Supplier port.

Use Tester for _related_suppliers = 0 and send passed features to GeometryReplacer to get the line without both start and end point within 1m.

To check if point are within 1m of the lines just Buffer the lines to 1m and send them to the Filter port of SpatialFilter and points to Candidate port. Failed output port will give you the points you need.

I have attached a sample workspace to get you started.


Forum|alt.badge.img
caracadrian wrote:

To check if there are points for start and end points of the line:

Create Xpoint and Ypoint attributes for the points (AttributeCreator Xpoint=@XValue, Ypoint=@YValue)

Use GeometryExtractor on the lines (it will come in handy later), use two CoordinateExtractor transformers on the lines in parallel configured as Specify Coordinates, one with 0 (start point) an one with -1 (end point) followed by VertexCreators set to Replace with Points. Buffer them to 1m and send them to the Requestor port of SpatialRelator and send points to the Supplier port.

Use Tester for _related_suppliers = 0 and send passed features to GeometryReplacer to get the line without both start and end point within 1m.

To check if point are within 1m of the lines just Buffer the lines to 1m and send them to the Filter port of SpatialFilter and points to Candidate port. Failed output port will give you the points you need.

I have attached a sample workspace to get you started.

You are awesome! I am really really appreciate your help. That helps a LOT!

Thank you for your help and I hope I can get familiar with the FME soon~ :)


Forum|alt.badge.img
caracadrian wrote:

To check if there are points for start and end points of the line:

Create Xpoint and Ypoint attributes for the points (AttributeCreator Xpoint=@XValue, Ypoint=@YValue)

Use GeometryExtractor on the lines (it will come in handy later), use two CoordinateExtractor transformers on the lines in parallel configured as Specify Coordinates, one with 0 (start point) an one with -1 (end point) followed by VertexCreators set to Replace with Points. Buffer them to 1m and send them to the Requestor port of SpatialRelator and send points to the Supplier port.

Use Tester for _related_suppliers = 0 and send passed features to GeometryReplacer to get the line without both start and end point within 1m.

To check if point are within 1m of the lines just Buffer the lines to 1m and send them to the Filter port of SpatialFilter and points to Candidate port. Failed output port will give you the points you need.

I have attached a sample workspace to get you started.

I have another question though. I want to use the "point and line tester" on each floor. For instance, all the points and lines on 1st floor, 2nd floor, 3nd floor will test it seperately. May I ask what kind of transformer I can use so that they will do it seperately?

Thanks in advance.


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • October 21, 2021
zacharylee1204 wrote:

I have another question though. I want to use the "point and line tester" on each floor. For instance, all the points and lines on 1st floor, 2nd floor, 3nd floor will test it seperately. May I ask what kind of transformer I can use so that they will do it seperately?

Thanks in advance.

Just enable Group Procesing on SpacialFilter and SpacialRelator and select the attribute that contains the floor ID. Make sure that both points and lines have the same floor ID


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