Skip to main content

Hello

 

I have several point data sets (different Excel files) that I would like to clean up. I would like to delete points with the same position (X,Y) and only keep the point with the highest height (Z).

I am currently deleting points with the same position with the Matcher Transformer. This works wonderfully. Now I have not yet found a way to say that the highest point at the location cannot be deleted. Is there a way in FME to influence the selection of the points to be deleted when cleaning different data sets? The height of the objects is available both as attributes and as 3D coordinates.

Thanks a lot

One way to do this is to use the CoordinateExtractor to get the _x, _y and _z from each point. Then use a Sorter to sort on _z numeric descending. Then use a Sampler set to 1st N features, group by _x and _y. This will let only one of the points through, which will be the one with the highest _z value as the were sorted this way.

 

This will only work if the coordinates matches exactly. With the Matcher this can be fixed using the Vector Tolerance parameter. As an alternative, you can use the Matched outputport from the Matcher, sort on _z numeric descending. Then use a Sampler set to 1st N features, group by _match_id.


Thanks a lot @nielsgerrits​ 

 

Both suggestions work perfectly. Especially the second suggestion was important in my case, because the coordinates differ slightly in parts. I can compensate for this with the tolerance function in the Matcher. Thanks a lot for the superfast help.


Thanks a lot @nielsgerrits​ 

 

Both suggestions work perfectly. Especially the second suggestion was important in my case, because the coordinates differ slightly in parts. I can compensate for this with the tolerance function in the Matcher. Thanks a lot for the superfast help.

Cheers :)


Reply