Question

file geodatabase raster histogram

  • 3 January 2014
  • 5 replies
  • 11 views

Badge +1
Hi FME fans, 

 

 

Does anyone know if it is possible to create a histogram for a raster in FME?

 

 

This would be similar to the 'calculate statistics' arcgis tool.

 

 

I am using the file geodatabase raster writer.

 

 

Thanks, 

 

 

Owen

5 replies

Userlevel 4
Badge +13
Hi Owen

 

There is no simple transformer for raster statistics or histograms in FME yet athough we are looking at adding one in the future. In the meantime Dmitri of Safe came up with an interesting way of getting a histogram by converting the rasters to point clouds and then splitting the point cloud on th ranges your want. Turns out this approach runs quite quickly.  I placed his workspace here temporarily so you can download it (I will put it on FMEPedia shortly):

 

https://www.dropbox.com/s/pescarzsy5n3cmh/RasterHistogram.fmw

 

 

Badge +1
Thanks Ken, thats interesting. at the moment i'll use batch calculate statistics in arc, but presumably it wouldnt be too difficult to read and write these as format attributes?

 

 

Userlevel 4
Badge +13
Hi Owen,

 

 

From what I know these stats are only used internally in ArcMap. Creating the stats is mainly used with creating raster pyramids for better visualisation.

 

This can be done with FME via format attributes.

 

 

Hope this helps,

 

 

Itay
Badge +2
Hi @Owen, I had a similar question, which I handled this way: Use RasterExpressionEvaluator to isolate a specific category in the raster. E.g., I was interested in the amount of nodata in the raster, so I used the expression IF (A[0] > 99999.0, 1, 0) to set nodata value to a value of 1 and all other data to a value of 0. After that I used a PointCloudCombiner to generate a pointcloud from the raster (point interval 1.0). Finally I used a PointCloudStatisticsCalculator to sum all z component values of the pointcloud. Since all values I was not interested in are zero, they don't contribute to the total sum. If you used a RasterPropertyExtractor to extract information on the raster, you can use that info to comput the area you're interested in. Like: total_area = sum(z) x spacing_x x spacing_y And so for any raster category you might be interested in.
Badge +7

Have there been any developments on this in the past 3 years? I'd like to do the same thing.

Reply