Skip to main content
Question

Apply max, mean, mode to building footprint using an elevation grid

  • September 26, 2016
  • 8 replies
  • 38 views

Forum|alt.badge.img

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.

8 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 26, 2016

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.


takashi
Influencer
  • September 26, 2016

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!


Forum|alt.badge.img
  • Author
  • September 26, 2016
itay wrote:

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.


Forum|alt.badge.img
  • Author
  • September 26, 2016
takashi wrote:

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.


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • September 26, 2016

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.


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 26, 2016
mark2atsafe wrote:

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

takashi
Influencer
  • September 27, 2016
mark2atsafe wrote:

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
Safer
Forum|alt.badge.img+44
  • Safer
  • September 27, 2016
takashi wrote:
@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.

 

 


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