2014-03-08

Calculate Spacing of Grid Points

(FME 2014 build 14235)

I got a dataset which contains 3D grid points.













The mission was to create a raster based on the data. As a requirement, each cell of the resultant raster would have to contain the original grid point at its center. That is, I had to create a raster whose cell spacing matches with the spacing of the grid points.
It was known that x, y spacings are constant, but the exact values were unknown. So I needed to calculate the spacings based on the point geometries.

At first, inspecting the data with the Data Inspector, I determined approximate ranges, and defined them as user parameters.
APPROX_MIN_X_SPACING, APPROX_MAX_X_SPACING
APPROX_MIN_Y_SPACING, APPROX_MAX_Y_SPACING

Then, I created a workflow like this to calculate the spacings.










In the actual dataset, x-spacing and y-spacing were the same value, but the workflow works even if they are different values.
There might be a quick function which calculates the spacing of grid points in FME, but I wasn't able to find it. If you know, tell me that!

No comments:

Post a Comment