NetCDF files often have a "longitude" and "latitude" variables (names may vary) containing longitude and latitude values of every pixels. For raster data in Pacific ocean, the range of longitude sometime cross the anti-meridian, where longitude values suddenly drop from +180° to -180°. This discontinuity breaks our attempt to compute an affine transform approximation in LocalizationGridBuilder, produces wrong results when interpolating values in this area of the grid, and makes more difficult to converge when performing an inverse transformation.
The proposed fix is to detect when such discontinuity happens, and add or subtract 360° on one side in order to get continuous values. Inconvenient is that some values become outside the [-180 … 180] range. In some case it can be outside the [0 … 360] range too (i.e. the data may turn around the Earth more than one lap).