I have two files: the first has x,y,z information and is a (big) point cloud file, and second has only x,y information and is a (small) point shp file. The two files occupy the same area.

For each of the x,y points in the shp file, I would like to find the nearest x,y point in the point cloud file and pass the corresponding point cloud z value to the attribute table of the shp file. I would also like to avoid converting the point cloud to any other format (due to file sizes)

I am fairly new to FME and I'm not sure what is the right tool for the job. After some research, I tried the SpatialRelator but this seems to be the wrong tool (at least by itself) because it does not seem to support a "near" (within a certain distance) calculation. Maybe I'm too used to ArcGIS, but FME does not seem to have a "spatial join" type tool, or at least they are calling it something else...


1 Answer 1


I don't think the NeighborFinder will work with the raw data because it treats the point cloud as an entire feature, so it only locates the centre point regardless. It seems that you will have to convert the point cloud geometry to something else.

As @alexgleith said, you could convert it to a surface and use draping. I would suggest using the PointCloudCoercer transformer to convert it to a set of point (or multi-point) features. Use a CoordinateExtractor to fetch the Z value for each and a 2DForcer to flatten the data.

Then you could use the NeighborFinder to get what you need.

Amendment: Having thought about it, there is a quicker method.

Create a buffer around your point feature using the Bufferer transformer. Set it to 100m (for example) in the same way you would for the NeighborFinder. Now use this buffer to clip the Point Cloud with the Clipper transformer.

What this will do is drastically reduce the amount of point cloud you are working with. From potentially billions of points you could be down to just a handful. Then using the above PointCloudCoercer/CoordinateExtractor/NeighborFinder method on the output from the Clipper should produce a result way, way, way, quicker.

I created an example...

enter image description here

...and placed the fmw file at: https://dl.dropboxusercontent.com/u/4200566/Community/PointCloudNearestNeighbor.fmw

  • 1
    I Mark, thanks for the advice. I understand the need to drape the point cloud to a surface, as alexgleith also points out, but I'm not sure why I need to convert the point cloud to points or multi-points. Does NeighborFinder work differently with when comparing points in a point cloud file vs. working on point or multi-point files? (Could you expand on what you mean by "it treats the point cloud as an entire feature, so it only locates the centre point regardless")?
    – youzer
    Jul 4, 2013 at 20:13
  • 1
    For performance reasons, a point cloud is stored in FME as a single "point cloud geometry". We're talking deep down in FME's internal engine here. I imagine it's some form of polygon mesh (en.wikipedia.org/wiki/Polygon_mesh) like in a video game, because it's way more efficient than trying to handle billions of points separately. But not every transformer can handle data in this structure - because the use cases are so rare - and the NeighborFinder is one of these. That's why you would need to actually convert the data to true points before using it. Jul 8, 2013 at 15:21
  • 1
    Having said that, I think this is a reasonable use case and I'll file an enhancement request to get it implemented. I just can't guarantee if and when it might be done. Jul 8, 2013 at 15:22
  • Thanks for the added information. With respect to point clouds being treated as a single point, does this mean that when using a clipper on a point cloud, the point cloud is first converted to some other data form, then clipped, then converted back - all "under the hood" so to speak?
    – youzer
    Jul 8, 2013 at 22:24
  • No. Any functionality specific to point clouds will operate on true point cloud data, under the hood. It's just functionality we didn't envisage being used on point clouds (like a nearest neighbour) that you would need a workaround. But those we can add native support for, if there turns out to be a demand for it. Jul 12, 2013 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.