Skip to main content

I'm sure this must be really simple but i can't seem to find a way of doing this using FME.

I have a number of polygons representing building footprints and need to calculate the max, mean & mode for each using a DTM.

The only options i've found so far would be to either;

- turn my polygons into points at vertexes and apply the values to these

 

- do a centrepointreplacer and just use that - not ideal for large buildings / those on slopes

i'm sure there must be a simple way to achieve this.

Hi @jamiefinney,

I would clip the DEM using the footprints and transform the rasters per footprint into points (RasterCellCoercer) after that use the StatisticsCalculator with a group by per footprint to get the statistics you need.

Hope this helps.


Hi @jamiefinney, another approach. I would transform the DEM to a point cloud with the PointCloudCombiner, clip it by the footprint polygons, and then compute statistics with the PointCloudStatisticsCalculator. Optionally you can restore the footprint polygon geometries by applying a pair of GeometryExtractor and GeometryReplacer. The point cloud technology in FME is fantastic!


Hi @jamiefinney,

I would clip the DEM using the footprints and transform the rasters per footprint into points (RasterCellCoercer) after that use the StatisticsCalculator with a group by per footprint to get the statistics you need.

Hope this helps.

thanks wondered if that might be the method I needed. hoped there might just be a single transformer i could use.


Hi @jamiefinney, another approach. I would transform the DEM to a point cloud with the PointCloudCombiner, clip it by the footprint polygons, and then compute statistics with the PointCloudStatisticsCalculator. Optionally you can restore the footprint polygon geometries by applying a pair of GeometryExtractor and GeometryReplacer. The point cloud technology in FME is fantastic!

@takashi thanks for your reply as well thats an interesting method - i'll have to see how they compare speedwise.


I'm thinking along the same lines as Takashi, with some differences.

1) I clipped the raster and used the RasterBandMinMaxExtractor - although admittedly it only gets you the min and max, not the mean or mode.

2) Instead of a GeometryExtractor/GeometryReplacer you can simply calculate the results and then copy them back onto the original features using a FeatureMerger (assuming they have a common name/ID)

Something like this:

That would work whether you use raster or point clouds.

Anyway, you probably have it working by now, but I thought I'd add this info to the existing answers.


I'm thinking along the same lines as Takashi, with some differences.

1) I clipped the raster and used the RasterBandMinMaxExtractor - although admittedly it only gets you the min and max, not the mean or mode.

2) Instead of a GeometryExtractor/GeometryReplacer you can simply calculate the results and then copy them back onto the original features using a FeatureMerger (assuming they have a common name/ID)

Something like this:

That would work whether you use raster or point clouds.

Anyway, you probably have it working by now, but I thought I'd add this info to the existing answers.

Hi @Mark2AtSafe and @takashi excellent approach, be very interesting comparing the vector vs pc approaches to evaluate ws preformance

I'm thinking along the same lines as Takashi, with some differences.

1) I clipped the raster and used the RasterBandMinMaxExtractor - although admittedly it only gets you the min and max, not the mean or mode.

2) Instead of a GeometryExtractor/GeometryReplacer you can simply calculate the results and then copy them back onto the original features using a FeatureMerger (assuming they have a common name/ID)

Something like this:

That would work whether you use raster or point clouds.

Anyway, you probably have it working by now, but I thought I'd add this info to the existing answers.

@Mark2AtSafe, yes, the RasterBandMinMaxExtractor use was also my first inspiration, but the goal is to get the max, mean, and mode, so it would not satisfy the requirement unfortunately. It might be useful if there were e.g. "RasterBandStatisticsCalculator" transformer.

 

@itay, in my experiences, performance of the point cloud approach was better than the vector coercing approach in many similar cases. Try that!
@Mark2AtSafe, yes, the RasterBandMinMaxExtractor use was also my first inspiration, but the goal is to get the max, mean, and mode, so it would not satisfy the requirement unfortunately. It might be useful if there were e.g. "RasterBandStatisticsCalculator" transformer.

 

@itay, in my experiences, performance of the point cloud approach was better than the vector coercing approach in many similar cases. Try that!
I filed an enhancement request. PR#72577.

 

 


Reply