Java error: “Comparison method violates its general contract!”

Hi there,

I am trying to put together a graph for processing large quantities of Sentinel-1 data and I keep receiving the following error:

Error: [NodeId: Ellipsoid-Correction-RD(2)] Comparison method violates its general contract!

My workflow includes general Read-> Import Vector-Apply Orbit File, but then splits into two different branches, both needing a geocoded product in the end. However, when I try to put geocoding operators in both branches it gives me the above error.

My sequences would be:
#1 Calibrate-> Mooltilook-> Land Mask-> Ellipsoid Correction/Terrain Correction
#2 ConvertDataType-> Land Mask -> Speckle Filter -> Ellipsoid/Terrain Correction (2)

It fails only for the second ellipsoid/terrrain correction (both operators, ellipsoid or terrain give the same error). Also, it fails if I try to perform that operation first and not at the end.

On stackexchange the explanation is that this is comparative error .

Any suggestions why this operator is behaving like so?

Thank you,

What is the ConvertDataType for? I don’t think it’s necessarily compatible with speckle-filtering.

Convert data type is intended to scale the data before exporting to image formats. For example to convert from Floats in the range of ±millions to integers in the range of 0…255. It something that should be done late in your processing rather than early.
I’m not sure if this relates to the original problem of comparison.

Hi @mengdahl and @lveci,

I don’t have a problem with the workflow as it is. It has been tested and worked fine before. The only thing that I need to include right now is the ellipsoid/terrain correction and my problem arises when I add this operatator to the graph.

I have tried to delete the second terrain correction operator (the one causing the error) and run everything through the same first operator, the one in the calibration chain. This also causes an error on reading the input bands (though a much more understandable one, it is kind of messy). I have also tried to swap the terrain correction and other operations (speckle and convert) and it the error still persists. I don’t see why it should have a comparison problem with Read, Import Vector, Apply orbit.

I would very much like to have all the pre-processing chain at once, so this is kind of causing me trouble.

You should/must speckle filter before you change the data type, unless you use some totally generic method like mean or median. And perhaps the terrain-correction simply does not run on 8-but integers for example? Why not change the data type as the last step?

@mengdahl I have tried to swap the position of the operators and do the terrain correction first and then convert. I simply receive the same error. It makes me think it is not working with two terrain correction operator nodes in the same graph, which is odd.


I just got the same Java error when I wanted to run the process “phase to elevation”. I solved the problem by using a higher accuracy elevation model as an input to the process, and the Java error was solved.
It might not directly related to your problem, but I thought I post it anyway, so it might help someone else who might get the same error. :slight_smile:

1 Like