Question

Compare all points in buffer and keep one with lowest height value


I have a point dataset, there is also an attribute with height values.

I want to apply a buffer of about 15 metres which will only check which points are nearest.

I then want to keep the point with the lowest value in height and only keep this point out of all the points which fall in the 15 metre buffer.

How can I go about this in FME Desktop?


4 replies

Userlevel 1
Badge +14

Hi @saqibamin​ thanks for your question!

I suggest using a Bufferer transformer to specify the units (eg. 15 meters) from your points and then use a Clipper transformer with the buffer as the "Clipper" and the points as the "Candidate". Then taking the "Inside" port you could calculate statistics with the StatisticsCalculator transformer selecting the min values of your attribute value (eg. height) and with a Tester transformer you can filter out for only those values to pass with an expression such as (@Value = @Value(min)).

For example, your workspace could look something like this:

imageYou could also explore using the NeighborFinder because that finds the closest features within the parameter you specify (in the units of your coordinate system) and outputs as a list if you prefer.

Badge +22

I would use a neighborFinder in Candidates only mode.

Keep Number of Neighbors to Find empty and set the Maximum distance to 15 (if your data is not in a metered projection, you'll want to reproject it first). In attribute Accumulation give a value to Closest Candidates List Name and add the height attribute and optionally an id attribute.

 

Use a ListSorter to sort the height attribute in Numeric Ascending mode.

 

Use a ListIndexer (index to Copy 0) to get the lowest value within the neighbours, add a prefix (ex. _neighbour_)

 

Use a tester to check if the feature 's height attribute is less than the _neighbour_height attribute.

Badge +22

I would use a neighborFinder in Candidates only mode.

Keep Number of Neighbors to Find empty and set the Maximum distance to 15 (if your data is not in a metered projection, you'll want to reproject it first). In attribute Accumulation give a value to Closest Candidates List Name and add the height attribute and optionally an id attribute.

 

Use a ListSorter to sort the height attribute in Numeric Ascending mode.

 

Use a ListIndexer (index to Copy 0) to get the lowest value within the neighbours, add a prefix (ex. _neighbour_)

 

Use a tester to check if the feature 's height attribute is less than the _neighbour_height attribute.

Caveat, if two points have the same height and are the lowest, they are either both kept, or both removed in the above scenario (depending on your tester < or <=).

You may wish to use a TestFilter for = and have special handling in that case.

Thank you both @jdh​ and @Evie Lapalme​ , I'll try these out.

Reply