Skip to main content

The vector data is a continuous set of numerically classified polygons (1 through to 6). I've used used VectorOnRasterOverlayer to do this but the output is not ideal. For some pixels there will be two or more different vector classes. I havent yet found a way to select which to use. If, for example, there are vector classes 1, 3 and 6 for a particular pixel, I'd like the highest value, 6, to always be used. Any suggestions?

 

Capture

@ac_wilson​  If you used the AreaOnAreaOverlayer, you'll get a continuous area coverage with no overlaps. In the AreaOnAreaOverlayer Parameters, select Generate List and select the 'classes' attribute. You could then use the ListSorter to sort the list in descending order and the list element {0} will be the class that you want.


Thanks for the direction @Mark Stoakes​ My understanding is that to use AreaOnAreaOverlayer I would have to convert the raster to a vector dataset first (RasterCellCoercer) and then process in vector. I was trying to avoid this as it seems really slow especially when my raster increases to 100 million pixels, hence my wish to process in raster. I came up with an alternative:

Capture3I split the vector polygon data into the classes I was interested in (Low, Medium, High), and carried out a vector overlay on each, to make 3 separate class rasters. Then combined them into one 3 band raster, which I then ran through the RasterExpressionEvaluator to choose the class I wanted to preserve where there was more than one. This seems to work, and work much faster.

I do have a couple of questions though:

  1. How do I control the order the VectorOnRasterOverlayers run, so I know what order the bands are populated by the RasterBandCombiner? I tried to control the output order from from the RasterCellValueReplacer but the Overlayers ran in exactly the opposite order...
  2. I've used a copy of a raster which I combine the output with again later, but it has it's original values so I need to zero out the pixels before running the Overlayers. Whats the best way to do this?

Many thanks for your advice,

Andy


@ac_wilson​ Sorry I misunderstood your question as you mentioned "I have polygon vector data". Perhaps if you can attach a small sample of the raster or vector I'll understand the problem


@ac_wilson​ Sorry I misunderstood your question as you mentioned "I have polygon vector data". Perhaps if you can attach a small sample of the raster or vector I'll understand the problem

Sorry, re-reading my original post I can see that it wasnt that clear... My starting point is a DEM raster. I want to join some vector data to this eg the quality of survey data at the pixel - the vector data. Where pixels span the edge between 2 or more polygons, I want to be able to select which vector data value to use, so I build up a matching raster with the worst case for each pixel. The solution I outlined above works, and is quick, I just need to be certain the order the bands are populated is repeatable, so that in turn the raster expression works repeatably, as Im referencing band(0), band(1) etc. I'll see if I can get some data together to upload. Thanks, Andy


Reply