diff --git a/src/main/java/org/locationtech/proj4j/Registry.java b/src/main/java/org/locationtech/proj4j/Registry.java index 72ca361..ab98da2 100755 --- a/src/main/java/org/locationtech/proj4j/Registry.java +++ b/src/main/java/org/locationtech/proj4j/Registry.java @@ -159,7 +159,7 @@ private synchronized void initialize() { register("bonne", BonneProjection.class, "Bonne (Werner lat_1=90)"); register("cass", CassiniProjection.class, "Cassini"); register("cc", CentralCylindricalProjection.class, "Central Cylindrical"); - register("cea", EqualAreaCylindricalProjection.class, "Equal Area Cylindrical"); + register("cea", CylindricalEqualAreaProjection.class, "Equal Area Cylindrical"); // register( "chamb", Projection.class, "Chamberlin Trimetric" ); register("collg", CollignonProjection.class, "Collignon"); register("crast", CrasterProjection.class, "Craster Parabolic (Putnins P4)"); @@ -194,8 +194,10 @@ private synchronized void initialize() { register("lagrng", LagrangeProjection.class, "Lagrange"); register("larr", LarriveeProjection.class, "Larrivee"); register("lask", LaskowskiProjection.class, "Laskowski"); - register("latlong", LongLatProjection.class, "Lat/Long"); - register("longlat", LongLatProjection.class, "Lat/Long"); + register("latlong", LongLatProjection.class, "Lat/Long (Geodetic alias)"); + register("longlat", LongLatProjection.class, "Lat/Long (Geodetic alias)"); + register("latlon", LongLatProjection.class, "Lat/Long (Geodetic alias)"); + register("lonlat", LongLatProjection.class, "Lat/Long (Geodetic)"); register("lcc", LambertConformalConicProjection.class, "Lambert Conformal Conic"); register("leac", LambertEqualAreaConicProjection.class, "Lambert Equal Area Conic"); // register( "lee_os", Projection.class, "Lee Oblated Stereographic" ); diff --git a/src/main/java/org/locationtech/proj4j/proj/CylindricalEqualAreaProjection.java b/src/main/java/org/locationtech/proj4j/proj/CylindricalEqualAreaProjection.java index 62e576b..5108c63 100644 --- a/src/main/java/org/locationtech/proj4j/proj/CylindricalEqualAreaProjection.java +++ b/src/main/java/org/locationtech/proj4j/proj/CylindricalEqualAreaProjection.java @@ -27,7 +27,6 @@ public class CylindricalEqualAreaProjection extends Projection { private double qp; private double[] apa; - private double trueScaleLatitude; public CylindricalEqualAreaProjection() { this(0.0, 0.0, 0.0); diff --git a/src/main/java/org/locationtech/proj4j/proj/EqualAreaCylindricalProjection.java b/src/main/java/org/locationtech/proj4j/proj/EqualAreaCylindricalProjection.java deleted file mode 100644 index fae44dc..0000000 --- a/src/main/java/org/locationtech/proj4j/proj/EqualAreaCylindricalProjection.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright 2009, 2017 Martin Davis - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.locationtech.proj4j.proj; - -import static java.lang.Math.abs; -import static java.lang.Math.asin; -import static java.lang.Math.sin; -import static org.locationtech.proj4j.util.ProjectionMath.EPS10; -import static org.locationtech.proj4j.util.ProjectionMath.HALFPI; -import static org.locationtech.proj4j.util.ProjectionMath.authlat; -import static org.locationtech.proj4j.util.ProjectionMath.authset; -import static org.locationtech.proj4j.util.ProjectionMath.qsfn; - -import org.locationtech.proj4j.ProjCoordinate; -import org.locationtech.proj4j.ProjectionException; - -/** - * The Equal Area Cylindrical projection. - */ -public class EqualAreaCylindricalProjection extends Projection { - - double apa[]; - double qp; - - public EqualAreaCylindricalProjection() { - minLatitude = Math.toRadians(-60); - maxLatitude = Math.toRadians(60); - minLongitude = Math.toRadians(-90); - maxLongitude = Math.toRadians(90); - initialize(); - } - - @Override - public ProjCoordinate project(double lplam, double lpphi, ProjCoordinate out) { - if (es != 0) { - // e_forward - out.x = scaleFactor * lplam; - out.y = 0.5 * qsfn(sin(lpphi), e, one_es) / scaleFactor; - } else { - // s_forward - out.x = scaleFactor * lplam; - out.y = sin(lpphi) / scaleFactor; - } - return out; - } - - @Override - protected ProjCoordinate projectInverse(double x, double y, ProjCoordinate dst) { - if (es != 0) { - // e_inverse - dst.x = authlat(asin(2d * y * scaleFactor / qp), apa); - dst.y = x / scaleFactor; - } else { - // s_inverse - double t; - - if ((t = abs(y *= scaleFactor)) - EPS10 <= 1.) { - if (t >= 1.) - dst.x = y < 0. ? -HALFPI : HALFPI; - else - dst.x = asin(y); - dst.y = x / scaleFactor; - } else throw new ProjectionException(); - } - return dst; - } - - @Override - public void initialize() { - super.initialize(); - if (es != 0) { - apa = authset(es); - qp = qsfn(1., e, one_es); - } - } - - public String toString() { - return "Equal Area Cylindrical"; - } -} diff --git a/src/test/resources/proj4-epsg.csv b/src/test/resources/proj4-epsg.csv index 7feb7d5..681a8a9 100644 --- a/src/test/resources/proj4-epsg.csv +++ b/src/test/resources/proj4-epsg.csv @@ -1493,7 +1493,7 @@ "4326 -> 3407","passing","EPSG","4326","EPSG","3407","1.0","-1.0","0.0","-4.1203006439011E7","-1.027783275293E7","0.0","1.000000","1.000000","1.000000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3408","passing","EPSG","4326","EPSG","3408","1.0","-1.0","0.0","158617.286076","-9087178.233242","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3409","passing","EPSG","4326","EPSG","3409","1.0","-1.0","0.0","155872.772909","8929945.179252","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" -"4326 -> 3410","failing","EPSG","4326","EPSG","3410","1.0","-1.0","0.0","96301.077465","-128394.917833","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" +"4326 -> 3410","passing","EPSG","4326","EPSG","3410","1.0","-1.0","0.0","96301.077465","-128394.917833","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3411","passing","EPSG","4326","EPSG","3411","1.0","-1.0","0.0","9025052.976399","-8715392.351348","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3412","passing","EPSG","4326","EPSG","3412","1.0","-1.0","0.0","211500.770422","1.2116871022335E7","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3413","passing","EPSG","4326","EPSG","3413","1.0","-1.0","0.0","9024858.222421","-8715204.279617","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" @@ -1848,7 +1848,7 @@ "4326 -> 3970","passing","EPSG","4326","EPSG","3970","1.0","-1.0","0.0","9766541.186236","106793.672654","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3973","passing","EPSG","4326","EPSG","3973","1.0","-1.0","0.0","158605.709728","-9086515.024711","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3974","passing","EPSG","4326","EPSG","3974","1.0","-1.0","0.0","155873.556203","8929990.054097","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" -"4326 -> 3975","failing","EPSG","4326","EPSG","3975","1.0","-1.0","0.0","96486.280251","-127566.985295","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" +"4326 -> 3975","passing","EPSG","4326","EPSG","3975","1.0","-1.0","0.0","96486.280251","-127566.985295","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3976","passing","EPSG","4326","EPSG","3976","1.0","-1.0","0.0","211496.210061","1.2116609759456E7","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3978","passing","EPSG","4326","EPSG","3978","1.0","-1.0","0.0","1.1394567715938E7","3952432.439572","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 3979","passing","EPSG","4326","EPSG","3979","1.0","-1.0","0.0","1.1394567715938E7","3952432.439572","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" @@ -2588,7 +2588,7 @@ "4326 -> 6925","passing","EPSG","4326","EPSG","6925","1.0","-1.0","0.0","3.8151513491838E7","7483236.836791","0.0","0.030480","0.030480","0.030480","","","","Auto-generated from proj.4 epsg database" "4326 -> 6931","passing","EPSG","4326","EPSG","6931","1.0","-1.0","0.0","158605.709728","-9086515.024711","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 6932","passing","EPSG","4326","EPSG","6932","1.0","-1.0","0.0","155873.556203","8929990.054097","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" -"4326 -> 6933","failing","EPSG","4326","EPSG","6933","1.0","-1.0","0.0","96486.280251","-127566.985295","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" +"4326 -> 6933","passing","EPSG","4326","EPSG","6933","1.0","-1.0","0.0","96486.280251","-127566.985295","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 6962","passing","EPSG","4326","EPSG","6962","1.0","-1.0","0.0","-2677190.737666","-4766506.168209","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 6984","passing","EPSG","4326","EPSG","6984","1.0","-1.0","0.0","-3837638.237021","-3019405.091929","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database" "4326 -> 6991","passing","EPSG","4326","EPSG","6991","1.0","-1.0","0.0","-3837638.237021","-3019405.091929","0.0","0.100000","0.100000","0.100000","","","","Auto-generated from proj.4 epsg database"