This kind of check is not applied anymore in Apache SIS. Instead we let the mathematical functions do their "natural" work, which may be to return NaN of infinity.
Command line:
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r11372:11373 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/AlbersEqualArea.java
Revision 11372 | Revision 11373 |
---|---|
} if (rho < 0.0) { // TODO: fix message (and check when this condition will occur) // this just checks for a tolerence error that may cause rho to be // close to -0.0, may be better to just round up in these cases throw new ProjectionException("Tolerance condition error"); } rho = Math.sqrt(rho) / n; y = rho0 - rho * Math.cos(x); x = rho * Math.sin(x); |
} if (rho < 0.0) { if (Math.abs(rho) < EPS) { rho = 0.0; } else { //TODO: can remove if someone can prove this condition will never happen throw new ProjectionException("Tolerance condition error"); } } rho = Math.sqrt(rho) / n; y = rho0 - rho * Math.cos(x); x = rho * Math.sin(x); |