Package org.osgeo.proj4j

Examples of org.osgeo.proj4j.ProjectionException


  public ProjCoordinate projectInverse(double xyx, double xyy, ProjCoordinate out) {
    out.x = xyx / (FXC * ( out.y = 2. - Math.abs(xyy) / FYC) );
    out.y = (4. - out.y * out.y) * C13;
    if (Math.abs(out.y) >= 1.) {
      if (Math.abs(out.y) > ONEEPSthrow new ProjectionException("I");
      else
        out.y = out.y < 0. ? -ProjectionMath.HALFPI : ProjectionMath.HALFPI;
    } else
      out.y = Math.asin(out.y);
    if (xyy < 0)
View Full Code Here


    sig = 0.5 * (p2 + p1);
    err = (Math.abs(del) < EPS || Math.abs(sig) < EPS) ? -42 : 0;
    del = del;

    if (err != 0)
      throw new ProjectionException("Error "+err);

    switch (type) {
    case TISSOT:
      n = Math.sin(sig);
      cs = Math.cos(del);
      rho_c = n / cs + cs / n;
      rho_0 = Math.sqrt((rho_c - 2 * Math.sin(projectionLatitude))/n);
      break;
    case MURD1:
      rho_c = Math.sin(del)/(del * Math.tan(sig)) + sig;
      rho_0 = rho_c - projectionLatitude;
      n = Math.sin(sig);
      break;
    case MURD2:
      rho_c = (cs = Math.sqrt(Math.cos(del))) / Math.tan(sig);
      rho_0 = rho_c + Math.tan(sig - projectionLatitude);
      n = Math.sin(sig) * cs;
      break;
    case MURD3:
      rho_c = del / (Math.tan(sig) * Math.tan(del)) + sig;
      rho_0 = rho_c - projectionLatitude;
      n = Math.sin(sig) * Math.sin(del) * Math.tan(del) / (del * del);
      break;
    case EULER:
      n = Math.sin(sig) * Math.sin(del) / del;
      del *= 0.5;
      rho_c = del / (Math.tan(del) * Math.tan(sig)) + sig; 
      rho_0 = rho_c - projectionLatitude;
      break;
    case PCONIC:
      n = Math.sin(sig);
      c2 = Math.cos(del);
      c1 = 1./Math.tan(sig);
      if (Math.abs(del = projectionLatitude - sig) - EPS10 >= ProjectionMath.HALFPI)
        throw new ProjectionException("-43");
      rho_0 = c2 * (c1 - Math.tan(del));
maxLatitude = Math.toRadians(60);//FIXME
      break;
    case VITK1:
      n = (cs = Math.tan(del)) * Math.sin(sig) / del;
View Full Code Here

      if (Math.abs(lat - y) < DEL_TOL) break;
      y = lat;
    }
    /* convergence failed */
    if (i <= 0) {
      throw new ProjectionException(this, ProjectionException.ERR_17);
    }
    out.x = lon;
    out.y = lat;
    return out;
  }
View Full Code Here

TOP

Related Classes of org.osgeo.proj4j.ProjectionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.