Skip to main content

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

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.


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~ :)


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.


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