Skip to main content

Hello,

I am looking for the possibility to count all points (3D) within a 3D body/sphere. Using the 3D buffer (it was faster than HUB3DBuffer, but less accurate) I have generated a solid body and now I want to check how many 3D points are inside this body. With the Spatial Relator apparently only points in a 2D space are checked. Is there a transformer in FME that does this job?

Thanks a lot.

You could convert your points into a pointcloud and clip the pointcloud with your sphere. Maybe you'll have to play around with your shere geometry type to have the ckipper treated it as a solid. The clipped pointcloud can than be counted for the total amount of single points by the PointcloudPropertyExtractor. In case you'd like to have the single inside points user the PointcloudCoercer to convert the Pointcloud feature back into several Point features.


Another thought. If you extract coordinates (x, y, z) of the sphere center and every candidate point and also the sphere radius is known, you can mathematically solve this question. That is, calculate 3D distance between the center and each point based on thier coordinates, and determine that a point is within the sphere if the distance is smaller than the radius.


Another thought. If you extract coordinates (x, y, z) of the sphere center and every candidate point and also the sphere radius is known, you can mathematically solve this question. That is, calculate 3D distance between the center and each point based on thier coordinates, and determine that a point is within the sphere if the distance is smaller than the radius.

Some python here for it - could be a fun CustomTransformer ;-)

https://www.geeksforgeeks.org/check-whether-a-point-lies-inside-a-sphere-or-not/


You could convert your points into a pointcloud and clip the pointcloud with your sphere. Maybe you'll have to play around with your shere geometry type to have the ckipper treated it as a solid. The clipped pointcloud can than be counted for the total amount of single points by the PointcloudPropertyExtractor. In case you'd like to have the single inside points user the PointcloudCoercer to convert the Pointcloud feature back into several Point features.

This should work well for the approximated Solid. Should be fairly quick too


Reply