Skip to main content
Solved

Sampling vector (point) data in FME


Forum|alt.badge.img

Hello !

I'm looking for a way to spatially sample a set of points (not a point cloud) in FME.

I want for the dataset on the following picture that all points must be a least a 10 meters from another one (by deleting the ones that are too close) because I have a too high density of geometry.

There is the "sampler" but it works on random selection and not on spatial constraint rule...

I've found a homemade technique to achieve that on the principle of the use of a succession of regular grids, spatial filter and counter to filter and delete some points. But the problem is that require a lot of time to run on large areas and it's not really optimized. I think there is an easy way to do the sampling operation on this type of data but I didn't found it (like we easily do it on point cloud).

Do you have an idea of how can I proceed? Is there a specific transformer to do it ?

 

Best answer by arnaudfouch

I apologize for this more than late reply...

The final solution that of redgeographics.

I just have put a Snapper, keeping points on the output "untouched" and that work perfectly ! :) The solution was so simple.

Thank you !

View original
Did this help you find an answer to your question?

8 replies

helmoet
Forum|alt.badge.img+8
  • January 19, 2020

Hi @arnaudfouch, you can use a SpatialSorter right before the Sampler and sample the features one for each groupID or HilbertOrder, which attributes are output from the SpatialSorter. Of course you will have to experiment with the Sort Precision and Group Size parameters of the SpatialSorter.


redgeographics
Celebrity
Forum|alt.badge.img+49
I wonder if a Snapper would be useful here, followed by removing duplicate points.

 

How important is it to maintain the separate lanes?


Forum|alt.badge.img
  • Author
  • January 19, 2020
redgeographics wrote:
I wonder if a Snapper would be useful here, followed by removing duplicate points.

 

How important is it to maintain the separate lanes?

It seems to be a great solution. With your proposition, I can set a specific distance and it's exactly what I want.

There is no importance to maintain the separate lanes, just a question of density. I just need to keep the "original" point and delete the ones that were moved because it is highly important that the geographic position keep valid after the operation.

I will test the solution and I will get you informed on the efficiency of your solution. I maybe will not have the time to do it this week so I'll let you know later.

Thanks


Forum|alt.badge.img
  • Author
  • January 19, 2020
helmoet wrote:

Hi @arnaudfouch, you can use a SpatialSorter right before the Sampler and sample the features one for each groupID or HilbertOrder, which attributes are output from the SpatialSorter. Of course you will have to experiment with the Sort Precision and Group Size parameters of the SpatialSorter.

Thanks for your answer. I'll check your proposition but it seems that the parameters of SpatialSorter and sampler don't allow to fix a specific sampling distance but I need to fix it.

I'll keep that in mind and I'll let you know the most effective solution.

Thanks


helmoet
Forum|alt.badge.img+8
  • January 19, 2020
helmoet wrote:

Hi @arnaudfouch, you can use a SpatialSorter right before the Sampler and sample the features one for each groupID or HilbertOrder, which attributes are output from the SpatialSorter. Of course you will have to experiment with the Sort Precision and Group Size parameters of the SpatialSorter.

Hm, sorry for not completely reading your question. It might be possible to 'fool' the SpatialSorter by first creating a bounding box around you pointdata. Since it uses a pointgrid of sortprecision * 100 which is warped over your data's bounds you could give the Hilbert array a meaning in terms of sampling distance. However, it would guarantee a maximum of one point with a 10x10m block, not a maximum distance to a neighboring point.


Forum|alt.badge.img+2
  • January 24, 2020

@arnaudfouch Is the thinning for the entire dataset or along the tracks? Can you share a small sample of the data?

If you want the thinning along the tracks then: Are the data points related in anyway. i.e. a track ID along with a time stamp? Do you want the tracks separated by the lanes or do you also want to combine the parallel tracks? Do you want to combine tracks the overlap? Do you have the road network with the appropriate centerlines - or is that what you're trying to create?


Forum|alt.badge.img
  • Author
  • Best Answer
  • February 6, 2020

I apologize for this more than late reply...

The final solution that of redgeographics.

I just have put a Snapper, keeping points on the output "untouched" and that work perfectly ! :) The solution was so simple.

Thank you !


Forum|alt.badge.img
  • Author
  • February 6, 2020
markatsafe wrote:

@arnaudfouch Is the thinning for the entire dataset or along the tracks? Can you share a small sample of the data?

If you want the thinning along the tracks then: Are the data points related in anyway. i.e. a track ID along with a time stamp? Do you want the tracks separated by the lanes or do you also want to combine the parallel tracks? Do you want to combine tracks the overlap? Do you have the road network with the appropriate centerlines - or is that what you're trying to create?

I've seen your answer to late but here is a little set of data. (csv.csv) The coordinates wgs84 are on 4,5,6 column and in 12,13,14 in EPSG:3946, Timestamp is at 11 (second of week).

I thinning for the entire dataset, irrespective to the lane. I just need to reduce the number of point with the only constraint to have in a global way at least a distance of 10m between the pts.

Follow track ID or timestamp are not to be taken into account. Just need to do a simple "sumsampling" step like it's usual to do with point cloud (Lidar...).


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings