Solved

I have a query about what is the most efficient way to count the number of cells in a raster grouped by a value in band 0 which exist inside a number of vector polygons?

  • 4 February 2021
  • 2 replies
  • 25 views

The datasets are not small the vector layer is 1600 polygons spanning over 150,000 hectares and the rasters are a 10 metre by 10 metre cell size over the same area. The rasters are slope classes of F,S,V,X in band 0, so my output would be polygon one has w number of "F", x number of "S", y number of "V" and z number of "X" cells. I hope that's a clear enough explanation of the problem!

icon

Best answer by deanatsafe 5 February 2021, 19:16

View original

2 replies

Badge +6

I would recommend trying the cast to point cloud route:

  1. Cast the raster to point cloud (PointCloudCombiner), making sure to capture the slope classes as point cloud components
  2. use your polygons to clip the point cloud
  3. use a pointcloudsplitter to split the pc by slope class
  4. run the results through a pointcloudstatisticscalculator

 

Thats the basic idea. This should scale well as point clouds are arrays just like raster grids and so you only get one feature per point cloud, not per point. Because of this casting is practically free. If you give it a try and get stuck, let us know and we can help you further here or you can just send what you have to support for a closer look.

Thanks Dean!

I have worked through a solution this morning using a point cloud combiner point cloud splitter and point cloud property extractors to produce the information.

 

Many many thanks as the other methods I was using were going to take hours, this completes in around five minutes!.

 

Regards

 

Andrew

Reply