Merge classified rasters with differing number of classes

132
1
2 weeks ago
JérémieTranchant
New Contributor

Hi,
In ArcPro 3.2, I have several tiles of 1km² as composite rasters (4 bands+NDVI+NDVIre+DSM). I classify each tile independantly with SVM and segmentation, using a training scheme with 8 classes. Classes have a classvalue and a classname attributes, which are the same for all tiles. However, the 8 classes are not present in all tiles, resulting in tiles having a varying number of classes. The resulting classified rasters are currently saved as 8bit TIF.

JrmieTranchant_0-1714038801356.png


My goal is to merge the classified rasters into a single classified raster, while retaining the attributes classname and classvalue, correctly assigned.

I have tried "Mosaic to New Raster" with varying parameters, as well as the full Mosaic process, and "Merge" and "Combine", all without success. The issue seems to lie in the "Value" attribute changing between tiles, and hence being associated with different classvalues as seen in the two attribute tables shown below. Class 5 is absent from the 1st raster (P71), while present in the second (P72), causing a mismatch between values in "Value" attribut and values in "classvalue"/"classname".

JrmieTranchant_1-1714038832908.pngJrmieTranchant_2-1714038846126.png

 

I am unsure how to proceed to merge these rasters while preserving the classification. Thank you for any  hint. 

1 Reply
DuncanHornby
MVP Notable Contributor

A possible solution to this is to reclassify your rasters before you do the mosaic. You want to be reclassifying the VALUE field (this being the field that holds the pixel value) into the value you have in your CLASSVALUE field. So taking your P71 example  VALUE becomes 1 when it was 0, 2 when is was 1 and so for.

I would do all this from backed up versions just in case you mess up the reclassify. Then when happy delete the backups.

 

0 Kudos