Skip to main content
Solved

Calculate percentage coverage from raster cell values


djmcdermott
Contributor
Forum|alt.badge.img+6

Good day FME'ers

I am trying to calculate the percentage green/grey from an single band NDVI raster image, i.e. the percentage of the raster that have cell values >= and < -0.1.

Can anybody help?

Thanks,

David McDermott

Best answer by jdh

Without dropping into python, I would suggest PointCloudCombiner to turn your raster into a point cloud, PointCloudSplitter (using the range you identify as green/grey) and then a PointCloudPropertyExtractor (don't extract any of the components) to get the number of points as an attribute.

 

 

Alternatively you could use the PointCloudFilter instead of the Splitter.
View original
Did this help you find an answer to your question?

4 replies

gavinpark
Contributor
Forum|alt.badge.img+8
  • Contributor
  • April 5, 2018

Are you trying to break the data down into areas like property boundaries or classify the whole image?

 

 

You should be able to use the RasterCellValueReplacer transformer to assign a lookup value for green and grey. Depending on how you are then looking at the output you should be able to calculate the amount of green/grey. Depending on if your looking at a region or the image level there are then a couple of different ways to look at the stats, but treating the raster as a PointCloud can be more performant.

djmcdermott
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 5, 2018

Hi @gavinpark3

I am starting by trying the classify a single tile to determine the green/grey percentage split withing the extent of the raster. I have read that treating the data as a point cloud could be better. The eventual aim is to assigned the % green/grey (or vegetation/other) to LSOA or Ward boundaries. Then a user can click on the polygon on the map and it'll provide info on how green an area is (like the Sterling Geo Smart Mapp). I hope that offers a bit more context.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • April 5, 2018

Without dropping into python, I would suggest PointCloudCombiner to turn your raster into a point cloud, PointCloudSplitter (using the range you identify as green/grey) and then a PointCloudPropertyExtractor (don't extract any of the components) to get the number of points as an attribute.

 

 

Alternatively you could use the PointCloudFilter instead of the Splitter.

djmcdermott
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • April 13, 2018
jdh wrote:

Without dropping into python, I would suggest PointCloudCombiner to turn your raster into a point cloud, PointCloudSplitter (using the range you identify as green/grey) and then a PointCloudPropertyExtractor (don't extract any of the components) to get the number of points as an attribute.

 

 

Alternatively you could use the PointCloudFilter instead of the Splitter.
Hi @jdh,

 

 

Thank you for your response. Using your advice I managed to cobble something together that does the trick. I have attached it to this comment for you and others to use/refine.

 

greengrey.fmw

 

 

Thanks

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