Skip to main content

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

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.

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.


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.

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

Reply