Skip to main content
Question

Raster area calculator


Forum|alt.badge.img
I'm looking for some transformer that would help me calculate the area of each raster value.

 

 

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?

8 replies

owen
Forum|alt.badge.img+1
  • July 23, 2015
Hi, the boundingboxreplacer (orientated) is what you need, should be v quick. for non uniform size rasters it will be necessary to use a no data setter, raster expression evaluator then raster to polygon coercer

Forum|alt.badge.img
  • Author
  • July 23, 2015
Hi Owen, thanks for your fast response! I've had a look at the boundingboxreplacer but I'm not sure how it can help me. Maybe I wasn't clear enough in my question :/

 

 

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.

takashi
Influencer
  • July 23, 2015
Hi,

 

 

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

owen
Forum|alt.badge.img+1
  • July 23, 2015
Ah I see, sorry. You could speed it up by using a rastercellrounder first

david_r
Celebrity
  • July 23, 2015
Hi

 

 

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

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • August 4, 2015
As you know the area of each cell all you need to do is extract a map of the values...

 

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.

 

 

Forum|alt.badge.img+5
  • January 7, 2016

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.


fdw
Contributor
Forum|alt.badge.img+6
  • Contributor
  • March 11, 2021
gainzmik wrote:
Hi Owen, thanks for your fast response! I've had a look at the boundingboxreplacer but I'm not sure how it can help me. Maybe I wasn't clear enough in my question :/

 

 

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.


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