Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.osgeo.proj4j;

import org.osgeo.proj4j.datum.*;

/**
* An interface for the operation of transforming
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.osgeo.proj4j;

import org.osgeo.proj4j.datum.Datum;

/**
* Creates {@link CoordinateTransform}s
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/main/java/org/osgeo/proj4j/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ public Ellipsoid getEllipsoid(String name)
return null;
}

private Map<String, Class> projRegistry;
private Map<String, Class<?>> projRegistry;

private void register( String name, Class cls, String description ) {
private void register( String name, Class<?> cls, String description ) {
projRegistry.put( name, cls );
}

public Projection getProjection( String name ) {
// if ( projRegistry == null )
// initialize();
Class cls = (Class)projRegistry.get( name );
Class<?> cls = (Class<?>)projRegistry.get( name );
if ( cls != null ) {
try {
Projection projection = (Projection)cls.newInstance();
Expand All @@ -135,7 +135,7 @@ private synchronized void initialize() {
// guard against race condition
if (projRegistry != null)
return;
projRegistry = new HashMap();
projRegistry = new HashMap<String,Class<?>>();
register( "aea", AlbersProjection.class, "Albers Equal Area" );
register( "aeqd", EquidistantAzimuthalProjection.class, "Azimuthal Equidistant" );
register( "airy", AiryProjection.class, "Airy" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class GeocentricConverter
double e2;
double ep2;

private static final double ITERATION_THRESHOLD = 4.8481368110953599e-08;
// private static final double ITERATION_THRESHOLD = 4.8481368110953599e-08;

public GeocentricConverter(Ellipsoid ellipsoid) {
this(ellipsoid.getA(), ellipsoid.getB());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public CSVRecordParser() {
public String[] parse(String record)
{
loc = 0;
List vals = new ArrayList();
List<String> vals = new ArrayList<String>();
int lineLen = record.length();
while (loc < lineLen) {
vals.add(parseField(record));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MetaCRSTestCase
{
private static final CoordinateTransformFactory ctFactory = new CoordinateTransformFactory();

private boolean verbose = true;
// private boolean verbose = true;

String testName;
String testMethod;
Expand Down
4 changes: 2 additions & 2 deletions trunk/src/main/java/org/osgeo/proj4j/io/Proj4FileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private String[] readFile( BufferedReader reader, String name)
if ( t.ttype != '>' )
throw new IOException( t.lineno()+": '>' expected" );
t.nextToken();
List v = new ArrayList();
List<String> v = new ArrayList<String>();

while ( t.ttype != '<' ) {
if ( t.ttype == '+' )
Expand Down Expand Up @@ -115,7 +115,7 @@ private String[] readFile( BufferedReader reader, String name)
return null;
}

private static void addParam(List v, String key, String value)
private static void addParam(List<String> v, String key, String value)
{
String plusKey = key;
if ( ! key.startsWith("+") )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class DatumParameters
private final static double SIXTH = .1666666666666666667; /* 1/6 */
private final static double RA4 = .04722222222222222222; /* 17/360 */
private final static double RA6 = .02215608465608465608; /* 67/3024 */
private final static double RV4 = .06944444444444444444; /* 5/72 */
private final static double RV6 = .04243827160493827160; /* 55/1296 */
// private final static double RV4 = .06944444444444444444; /* 5/72 */
// private final static double RV6 = .04243827160493827160; /* 55/1296 */

private Datum datum = null;
private double[] datumTransform = null;
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/main/java/org/osgeo/proj4j/parser/Proj4Keyword.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class Proj4Keyword

private static Set<String> supportedParams = null;

public static synchronized Set supportedParameters()
public static synchronized Set<String> supportedParameters()
{
if (supportedParams == null) {
supportedParams = new TreeSet<String>();
Expand Down Expand Up @@ -109,10 +109,10 @@ public static void checkUnsupported(String paramKey)
}
}

public static void checkUnsupported(Collection params)
public static void checkUnsupported(Collection<String> params)
{
for (Object s : params) {
checkUnsupported((String) s);
for (String s : params) {
checkUnsupported(s);
}
}
}
19 changes: 10 additions & 9 deletions trunk/src/main/java/org/osgeo/proj4j/parser/Proj4Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import java.util.HashMap;
import java.util.Map;

import org.osgeo.proj4j.*;
import org.osgeo.proj4j.CoordinateReferenceSystem;
import org.osgeo.proj4j.InvalidValueException;
import org.osgeo.proj4j.Registry;
import org.osgeo.proj4j.datum.Datum;
import org.osgeo.proj4j.datum.Ellipsoid;
import org.osgeo.proj4j.proj.Projection;
import org.osgeo.proj4j.proj.TransverseMercatorProjection;
import org.osgeo.proj4j.units.Angle;
import org.osgeo.proj4j.units.AngleFormat;
import org.osgeo.proj4j.units.Unit;
import org.osgeo.proj4j.units.Units;
import org.osgeo.proj4j.util.ProjectionMath;
Expand All @@ -27,7 +28,7 @@ public CoordinateReferenceSystem parse(String name, String[] args)
if (args == null)
return null;

Map params = createParameterMap(args);
Map<String,String> params = createParameterMap(args);
Proj4Keyword.checkUnsupported(params.keySet());
DatumParameters datumParam = new DatumParameters();
parseDatum(params, datumParam);
Expand All @@ -45,7 +46,7 @@ public CoordinateReferenceSystem parse(String name, String[] args)
* Creates a {@link Projection}
* initialized from a PROJ.4 argument list.
*/
private Projection parseProjection( Map params, Ellipsoid ellipsoid ) {
private Projection parseProjection( Map<String,String> params, Ellipsoid ellipsoid ) {
Projection projection = null;

String s;
Expand Down Expand Up @@ -136,7 +137,7 @@ private Projection parseProjection( Map params, Ellipsoid ellipsoid ) {
return projection;
}

private void parseDatum(Map params, DatumParameters datumParam)
private void parseDatum(Map<String,String> params, DatumParameters datumParam)
{
String towgs84 = (String) params.get(Proj4Keyword.towgs84);
if (towgs84 != null) {
Expand Down Expand Up @@ -193,7 +194,7 @@ private double[] parseToWGS84(String paramList)
return param;
}

private void parseEllipsoid(Map params, DatumParameters datumParam)
private void parseEllipsoid(Map<String,String> params, DatumParameters datumParam)
{
double b = 0;
String s;
Expand Down Expand Up @@ -280,7 +281,7 @@ private void parseEllipsoid(Map params, DatumParameters datumParam)
* @param params
* @param datumParam
*/
private void parseEllipsoidModifiers(Map params, DatumParameters datumParam)
private void parseEllipsoidModifiers(Map<String,String> params, DatumParameters datumParam)
{
/**
* Modifiers are mutually exclusive, so when one is detected method returns
Expand All @@ -292,8 +293,8 @@ private void parseEllipsoidModifiers(Map params, DatumParameters datumParam)

}

private Map createParameterMap(String[] args) {
Map params = new HashMap();
private Map<String,String> createParameterMap(String[] args) {
Map<String,String> params = new HashMap<String,String>();
for (int i = 0; i < args.length; i++) {
String arg = args[i];
// strip leading "+" if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class BoggsProjection extends PseudoCylindricalProjection {

private final static int NITER = 20;
private final static double EPS = 1e-7;
private final static double ONETOL = 1.000001;
// private final static double ONETOL = 1.000001;
private final static double FXC = 2.00276;
private final static double FXC2 = 1.11072;
private final static double FYC = 0.49931;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CassiniProjection extends Projection {
private double tn;
private double[] en;

private final static double EPS10 = 1e-10;
// private final static double EPS10 = 1e-10;
private final static double C1 = .16666666666666666666;
private final static double C2 = .00833333333333333333;
private final static double C3 = .04166666666666666666;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

public class CentralCylindricalProjection extends CylindricalProjection {

private double ap;

private final static double EPS10 = 1.e-10;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class Eckert4Projection extends Projection {

private final static double C_x = .42223820031577120149;
private final static double C_y = 1.32650042817700232218;
private final static double RC_y = .75386330736002178205;
// private final static double RC_y = .75386330736002178205;
private final static double C_p = 3.57079632679489661922;
private final static double RC_p = .28004957675577868795;
// private final static double RC_p = .28004957675577868795;
private final static double EPS = 1e-7;
private final int NITER = 6;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class EquidistantAzimuthalProjection extends AzimuthalProjection {

private int mode;
private double[] en;
private double M1;
// private double M1;
private double N1;
private double Mp;
private double He;
Expand Down Expand Up @@ -201,7 +201,6 @@ public ProjCoordinate projectInverse(double x, double y, ProjCoordinate lp) {
}
} else {
double c, Az, cosAz, A, B, D, E, F, psi, t;
int i;

if ((c = ProjectionMath.distance(x, y)) < EPS10) {
lp.y = projectionLatitude;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class EquidistantConicProjection extends ConicProjection {

private double eccentricity = 0.822719;
private double eccentricity2 = eccentricity*eccentricity;
private double eccentricity4 = eccentricity2*eccentricity2;
private double eccentricity6 = eccentricity2*eccentricity4;
// private double eccentricity4 = eccentricity2*eccentricity2;
// private double eccentricity6 = eccentricity2*eccentricity4;
private double radius = 1;

private boolean northPole;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

public class LoximuthalProjection extends PseudoCylindricalProjection {

private final static double FC = .92131773192356127802;
private final static double RP = .31830988618379067154;
// private final static double FC = .92131773192356127802;
// private final static double RP = .31830988618379067154;
private final static double EPS = 1e-8;

private double phi1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public ProjCoordinate project(double lplam, double lpphi, ProjCoordinate out) {
}

public ProjCoordinate projectInverse(double xyx, double xyy, ProjCoordinate out) {
double t, s;
double t;

out.y = C2 * (t = ProjectionMath.asin(xyy / C_y));
out.x = xyx / (C_x * (1. + 3. * Math.cos(out.y)/Math.cos(t)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public ProjCoordinate project(double lplam, double lpphi, ProjCoordinate out) {
}

public ProjCoordinate projectInverse(double xyx, double xyy, ProjCoordinate out) {
double th, s;

out.x = 2. * xyx / (1. + Math.cos(xyy));
out.y = ProjectionMath.asin(0.5 * (xyy + Math.sin(xyy)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ObliqueMercatorProjection extends CylindricalProjection {
private final static double TOL = 1.0e-7;

private double lamc, lam1, phi1, lam2, phi2, Gamma, al, bl, el, singam, cosgam, sinrot, cosrot, u_0;
private boolean ellips, rot;
private boolean rot;

public ObliqueMercatorProjection() {
ellipsoid = Ellipsoid.WGS84;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
package org.osgeo.proj4j.proj;

import org.osgeo.proj4j.ProjCoordinate;
import org.osgeo.proj4j.ProjectionException;
import org.osgeo.proj4j.util.ProjectionMath;

public class ObliqueStereographicAlternativeProjection extends GaussProjection {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class RobinsonProjection extends PseudoCylindricalProjection {
private final static double FYC = 1.3523;
private final static double C1 = 11.45915590261646417544;
private final static double RC1 = 0.08726646259971647884;
private final static double ONEEPS = 1.000001;
// private final static double ONEEPS = 1.000001;
private final static double EPS = 1e-8;

public RobinsonProjection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ public boolean hasInverse() {

public void initialize() {
super.initialize();
double del, cs, dummy;
double del, cs;

/* get common factors for simple conics */
double p1, p2, d, s;
double p1, p2;
int err = 0;

/*FIXME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.osgeo.proj4j.ProjCoordinate;
import org.osgeo.proj4j.ProjectionException;
import org.osgeo.proj4j.datum.Ellipsoid;
import org.osgeo.proj4j.util.ProjectionMath;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class VanDerGrintenProjection extends Projection {

private final static double TOL = 1.e-10;
private final static double THIRD = .33333333333333333333;
private final static double TWO_THRD = .66666666666666666666;
// private final static double TWO_THRD = .66666666666666666666;
private final static double C2_27 = .07407407407407407407;
private final static double PI4_3 = 4.18879020478639098458;
private final static double PISQ = 9.86960440108935861869;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ public CoordinateTransformTester(boolean verbose) {
this.verbose = verbose;
}

private ProjCoordinate p = new ProjCoordinate();
private ProjCoordinate p2 = new ProjCoordinate();

public boolean checkTransformFromWGS84(String name, double lon, double lat, double x, double y)
{
return checkTransformFromWGS84(name, lon, lat, x, y, 0.0001);
Expand Down
1 change: 0 additions & 1 deletion trunk/src/test/java/org/osgeo/proj4j/FeatureTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.osgeo.proj4j;

import junit.framework.TestCase;
import junit.textui.TestRunner;

/**
Expand Down
1 change: 0 additions & 1 deletion trunk/src/test/java/org/osgeo/proj4j/Proj4JSTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.osgeo.proj4j;

import junit.framework.TestCase;
import junit.textui.TestRunner;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.osgeo.proj4j;

import junit.framework.Assert;
import junit.framework.TestCase;
import junit.textui.TestRunner;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public double[] getExtent()
}
public boolean runGrid(double tolerance)
{
boolean isWithinTolerance = true;

gridExtent = gridExtent(cs.getProjection());
double minx = gridExtent[0];
Expand Down