Codota Logo
ProjectionException
Code IndexAdd Codota to your IDE (free)

How to use
ProjectionException
in
org.apache.sis.referencing.operation.projection

Best Java code snippets using org.apache.sis.referencing.operation.projection.ProjectionException (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: Geomatys/geotoolkit

/**
 * Iteratively solve equation (7-9) from Snyder. This is the converse of {@link #tsfn}.
 * The input should be a positive number, otherwise the result will be either outside
 * the [-π/2 ... π/2] range, or will be NaN. Its behavior at some particular points is:
 * <p>
 * <ul>
 *   <li>If {@code ts} is zero, then the result is close to π/2.</li>
 *   <li>If {@code ts} is 1, then the result is close to zero.</li>
 *   <li>If {@code ts} is positive infinity, then the result is close to -π/2.</li>
 * </ul>
 *
 * @param  ts The value returned by {@link #tsfn}.
 * @return The latitude in radians.
 * @throws ProjectionException if the iteration does not converge.
 */
final double cphi2(final double ts) throws ProjectionException {    // == φ(ts)
  final double he = 0.5 * eccentricity;
  double φ = (PI/2) - 2.0 * atan(ts);
  for (int i=0; i<MAXIMUM_ITERATIONS; i++) {
    final double con  = eccentricity * sin(φ);
    final double dphi = abs(φ - (φ = PI/2 - 2.0*atan(ts * pow((1-con)/(1+con), he))));
    if (dphi <= ITERATION_TOLERANCE) {
      return φ;
    }
  }
  if (isNaN(ts)) {
    return NaN;
  }
  throw new ProjectionException(Errors.format(Errors.Keys.NoConvergence));
}
origin: Geomatys/geotoolkit

throw new ProjectionException(Errors.format(Errors.Keys.NoConvergence));
origin: org.apache.sis.core/sis-referencing

throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
origin: Geomatys/geotoolkit

  /**
   * Calculates the latitude ({@code φ}) from a meridian distance.
   * Determines φ to a tenth of {@value #ITERATION_TOLERANCE} radians.
   *
   * @param  delta meridian distance to calculate latitude for.
   * @return The latitude of the meridian distance.
   * @throws ProjectionException if the iteration does not converge.
   */
  final double inv_mlfn(final double delta) throws ProjectionException {
    final double k = 1/(1 - eccentricitySquared);
    double φ = delta;
    int i=MAXIMUM_ITERATIONS;
    do { // rarely goes over 5 iterations
      final double s = sin(φ);
      double t = 1 - eccentricitySquared * (s*s);
      t = (mlfn(φ, s, cos(φ)) - delta) * (t * sqrt(t)) * k;
      φ -= t;
      if (abs(t) < ITERATION_TOLERANCE/10) {
        return φ;
      }
    } while (--i >= 0);
    throw new ProjectionException(Errors.format(Errors.Keys.NoConvergence));
  }
}
origin: apache/sis

throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
origin: Geomatys/geotoolkit

throw new ProjectionException(Errors.format(Errors.Keys.TestFailure_3, variable,
origin: Geomatys/geotoolkit

throw new ProjectionException(Errors.format(Errors.Keys.NoConvergence));
origin: Geomatys/geotoolkit

do {
  if (--i < 0) {
    throw new ProjectionException(Errors.format(Errors.Keys.NoConvergence));
origin: org.apache.sis.core/sis-referencing

if (abs(λ) > PI/2) {
  throw new ProjectionException(Errors.format(Errors.Keys.OutsideDomainOfValidity));
origin: apache/sis

do {
  if (--nbIte < 0) {
    throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
throw new ProjectionException(e);
origin: Geomatys/geotoolkit

do {
  if (--i < 0) {
    throw new ProjectionException(Errors.format(Errors.Keys.NoConvergence));
origin: Geomatys/geotoolkit

if (sinc > 1) {
  if (sinc - 1 > ANGLE_TOLERANCE) {
    throw new ProjectionException(Errors.format(Errors.Keys.PointOutsideHemisphere));
origin: apache/sis

throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
origin: org.apache.sis.core/sis-referencing

throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
origin: apache/sis

if (abs(λ) > PI/2) {
  throw new ProjectionException(Errors.format(Errors.Keys.OutsideDomainOfValidity));
origin: Geomatys/geotoolkit

throw new ProjectionException(Errors.format(Errors.Keys.PointOutsideHemisphere));
origin: org.apache.sis.core/sis-referencing

throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
origin: apache/sis

throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
origin: apache/sis

/**
 * Computes φ using the iterative method used by USGS.
 * This is the second part of the {@link ConformalProjection#φ(double)} method.
 *
 * @param  t  the {@code expOfSouthing} parameter value.
 * @return the latitude (in radians) for the given parameter.
 * @throws ProjectionException if the iteration does not converge.
 */
public double byIterativeMethod(final double t) throws ProjectionException {
  final double hℯ = 0.5 * eccentricity;
  double φ = (PI/2) - 2*atan(t);                                          // Snyder (7-11)
  for (int it=0; it < NormalizedProjection.MAXIMUM_ITERATIONS; it++) {    // Iteratively solve equation (7-9) from Snyder
    final double ℯsinφ = eccentricity * sin(φ);
    final double Δφ = φ - (φ = PI/2 - 2*atan(t * pow((1 - ℯsinφ)/(1 + ℯsinφ), hℯ)));
    if (abs(Δφ) <= NormalizedProjection.ITERATION_TOLERANCE) {
      return φ;
    }
  }
  if (Double.isNaN(t)) {
    return Double.NaN;
  }
  throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
}
origin: Geomatys/geotoolkit

throw new ProjectionException(c[i].x + " outside of (" + x.getMinimumValue() + "," + x.getMaximumValue() + ")");
throw new ProjectionException(c[i].y + " outside of (" + y.getMinimumValue() + "," + y.getMaximumValue() + ")");
org.apache.sis.referencing.operation.projectionProjectionException

Javadoc

Thrown by NormalizedProjection when a map projection failed.
When this exception is thrown
Apache SIS implementations of map projections return a Double#isFinite(double) number under normal conditions, but may also return an Double#isInfinite(double) number or Double#isNaN(double) value, or throw this exception. The behavior depends on the reason why the projection can not return a finite number:
  • If the expected mathematical value is infinite (for example the Mercator projection at ±90° of latitude), then the map projection should return a Double#POSITIVE_INFINITY or Double#NEGATIVE_INFINITY, depending on the sign of the correct mathematical answer.
  • If no real number is expected to exist for the input coordinate (for example at a latitude greater than 90°), then the map projection should return Double#NaN.
  • If a real number is expected to exist but the map projection fails to compute it (for example because an iterative algorithm does not converge), then the projection should throw ProjectionException.

Most used methods

  • <init>
    Constructs a new exception with the specified cause. The details message is copied from the cause.

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • orElseThrow (Optional)
  • findViewById (Activity)
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Reference (javax.naming)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now