I am working on a project where I cross-classify several regions with each other. In other words: I train several classifiers on imagery from different regions and classify all images of all regions with each of them.
I have one problem I can not solve for days already:
My training/test data for all regions is contained in one shapefile I loaded in GEE. The table contains the region name and the class (0-3) for my classification. Having the data of all regions in one shapefile means, they all have the same structure and therefor if it works for one region, it should work for all of them. It doesn't though. I can run my classifications for region 'LVha-1' for example and get results for them. As I run the same code, just referring to region 'CMeu-3' instead of 'LVha-1', I get errors that there is no valid training data. Examining the featureCollection, filtering by region name also gives back 0 elements for this region (and some others), even if they are definitively in my shapefile.
I figure it is best to share my script as link.
This one works (region 'LVha-1'):
https://code.earthengine.google.com/4077f41e36189a1aae01fb86716a99ae
with assets:
var regions = https://code.earthengine.google.com/?asset=users/pottsbill/polygons
var training = https://code.earthengine.google.com/?asset=users/pottsbill/regions
The classifications sometimes return an overall accuracy of 0. This happens for classifications of exactly those regions for which the dataset seems not to contain data (even if it actually does).
The following code doesn't work. It should train the classifier on data of region 'CMeu-3' but there seems to be no training and test data. It is exactly the same code as before, just changed the region name wherever neccessary:
https://code.earthengine.google.com/87615e318d901f69ef6c33d3e6387af3
Sorry for just posting the links here but as the script actually should be fine and there is no single part in it which I am struggling with, I figure this is the most helpful.
I am really puzzled what might be the reason. I figured it might be that some regions have too many polygons or vertices but looking at the data there seems to be no correlation.
I am mainly looking for ideas what could be the root of my problem. I already ruled out that there might be too many vertices in some of the regions but maybe there are other sensitivities of GEE I am not aware of.