I tried vectorizing it using "RasterToPolygonCoercer" and then using "Area Calculator" and "Statistics Calculator", but it takes too long because there are many rasters and they're quite big.
Is there any other approach I could use?
I tried vectorizing it using "RasterToPolygonCoercer" and then using "Area Calculator" and "Statistics Calculator", but it takes too long because there are many rasters and they're quite big.
Is there any other approach I could use?
Given a raster file that contains values between 1 and 100, for example, I need to know how much area each of the values occupies. I know the area of each raster cell, so if I knew how many cell per each value are present, it should be easy, but i'm not sure how to get there with FME.
As far as I know, there isn't a very fast way to count the number of cells grouped by each pixel value. The RasterCellCoercer could be relatively faster than the RasterToPolygonCoercer.
Takashi
Yes, try the RasterCellCoercer and convert to points. That should be a bit faster than converting to polygons. Then count the number of points per value and multiply by the area of the raster cell size.
David
This boils down to creating a table.
Then u can use statistics/aggreagtion/list techniques to assemble the total area.
If you need to know the area of cells of same value wich are adjacent to one or more, things get a bit more complicated of course.
But the data in tabular form can be effctively queried for just this.
If the areas have unique pixel values then the rasterextentscoercer set to data extents in teh extents type dialog and then an area calculator should do what you need - this is a lot quicker then the other coercers that vectorise each raster cell. If you don't change the 'extents type' it will give you a polygon of the entire image.
If its more of a scanned map then this probably wont work.
Given a raster file that contains values between 1 and 100, for example, I need to know how much area each of the values occupies. I know the area of each raster cell, so if I knew how many cell per each value are present, it should be easy, but i'm not sure how to get there with FME.
In case anyone bumps into this just like I did, coercing the raster into a pointcloud (geometrycoercer) massively increases the speed.
The pixel value becomes the Z-component. This makes it possible to split the pointcloud and extract the amount of points per rastervalue. Use a PointcloudPropertyExtractor: _num_points. Eac point represents one rastercell.