New classification modes

Could you a link to a subset dataset with the training vectors? How many labels are used?

I used 4 classes.

You can have a look at the data here. The training areas are relatively small but the error also occurs with larger ones.

Ok it should be fixed now. The problem was that it wasn’t handling the projection from the vectors properly so it never found them to intersect with the current tile. The ‘bound must be positive’ error comes from RF when the training set is empty. I’ll add this to be released in the next update.
Thanks

3 Likes

That’s fantastic, thanks so much, @lveci!

How did you fixed it @lveci ?
I am having the same problem with my sentinel2-data. The data is allready been projected. But it still does not work. I have also the last version of SNAP. Should I project the vector data? and if, how?


Thanks

are raster and vector data projected in the same coordinate reference system?

yes


How did you fix bound must be positive error? I am getting the same error in my classification random forest as well.

did you import the training vectors from a shapefile/CSV or did you digitize them directly in SNAP?

1 Like

I digitised them directly in SNAP.

Is your data projected to a coordinate system?

Yes. on WGS-84 coordinate system

Please have a look at the coordinates of your training data. You can see them by double clicking it and looking at the entry in the table. It is in WKT format and starts with POLYGON(…
The coordinates in there should range within the latitudes and longitudes of your data.

It is appearing like this after double clicking.

you will have to make the geometry column a bit broader to see what comes after the (( :pensive:

Maybe the coordinates of the polygons were stored in raster coordinates and not in lat/lon coordinates, thus being outside the raster’s extent (=out of bounds).

1 Like

Oh sorry, my bad.

And yes, the coordinates are being stored in Cartesian format and not in Lat Lon format. Can you tell me what can I do in that case?

maybe you digitized them before geocoding?

You can try different things:

  • make a new training vector, now that your data is geocoded and see if it now contains lat/lon coordinates.
  • save your data as a new BEAM DIMAP file. For me, the vectors were then converted to the geographic coordinates.
  • Digitize your training samples in a GIS (as WGS84) and import them as polygons as described here: Can't import vector data

I have converted the coordinates to Lat/Lon as per your advice. Still, the problem persists. I am still getting “bound must be positive” error.

Sorry for the late reply,
I found the same error and I solved it when it realized that some images of my stack were empty (because an error occurred in previous steps). Re-build the stack without these corrupted images solved the problem.
I wonder it works for you and other people with this message

thank you for sharing your solution