org.openstreetmap.josm.data.projection
Class AbstractProjection

java.lang.Object
  extended by org.openstreetmap.josm.data.projection.AbstractProjection
All Implemented Interfaces:
Projection
Direct Known Subclasses:
BelgianLambert1972, BelgianLambert2008, CustomProjection, Epsg3008, GaussKrueger, Lambert, Lambert93, LambertCC9Zones, LambertEST, Mercator, Puwg, SwissGrid, TransverseMercatorLV, UTM, UTM_France_DOM

public abstract class AbstractProjection
extends java.lang.Object
implements Projection

Implementation of the Projection interface that represents a coordinate reference system and delegates the real projection and datum conversion to other classes. It handles false easting and northing, central meridian and general scale factor before calling the delegate projection. Forwards lat/lon values to the real projection in units of radians. The fields are named after Proj.4 parameters. Subclasses of AbstractProjection must set ellps and proj to a non-null value. In addition, either datum or nadgrid has to be initialized to some value.


Field Summary
protected  Datum datum
           
protected  Ellipsoid ellps
           
protected  double k_0
           
protected  double lon_0
           
protected  Proj proj
           
protected  double x_0
           
protected  double y_0
           
 
Constructor Summary
AbstractProjection()
           
 
Method Summary
protected static double convertDegreeMinuteSecond(double degree, double minute, double second)
           
protected static double convertMinuteSecond(double minute, double second)
           
 void dump()
           
 LatLon eastNorth2latlon(EastNorth en)
          Convert from norting/easting to lat/lon.
 double getCentralMeridian()
           
 Datum getDatum()
           
 double getDefaultZoomInPPD()
          The default scale factor in east/north units per pixel (#NavigatableComponent#scale)) FIXME: misnomer
 Ellipsoid getEllipsoid()
           
abstract  java.lang.Integer getEpsgCode()
           
 double getFalseEasting()
           
 double getFalseNorthing()
           
 Proj getProj()
           
 double getScaleFactor()
           
 EastNorth latlon2eastNorth(LatLon ll)
          Convert from lat/lon to northing/easting.
 java.lang.String toCode()
          Default implementation of toCode().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.josm.data.projection.Projection
getCacheDirectoryName, getWorldBoundsLatLon, toString
 

Field Detail

ellps

protected Ellipsoid ellps

datum

protected Datum datum

proj

protected Proj proj

x_0

protected double x_0

y_0

protected double y_0

lon_0

protected double lon_0

k_0

protected double k_0
Constructor Detail

AbstractProjection

public AbstractProjection()
Method Detail

getEllipsoid

public final Ellipsoid getEllipsoid()

getDatum

public final Datum getDatum()

getProj

public final Proj getProj()

getFalseEasting

public final double getFalseEasting()

getFalseNorthing

public final double getFalseNorthing()

getCentralMeridian

public final double getCentralMeridian()

getScaleFactor

public final double getScaleFactor()

latlon2eastNorth

public EastNorth latlon2eastNorth(LatLon ll)
Description copied from interface: Projection
Convert from lat/lon to northing/easting.

Specified by:
latlon2eastNorth in interface Projection
Parameters:
ll - The geo point to convert. x/y members of the point are filled.

eastNorth2latlon

public LatLon eastNorth2latlon(EastNorth en)
Description copied from interface: Projection
Convert from norting/easting to lat/lon.

Specified by:
eastNorth2latlon in interface Projection
Parameters:
en - The geo point to convert. lat/lon members of the point are filled.

getDefaultZoomInPPD

public double getDefaultZoomInPPD()
Description copied from interface: Projection
The default scale factor in east/north units per pixel (#NavigatableComponent#scale)) FIXME: misnomer

Specified by:
getDefaultZoomInPPD in interface Projection

getEpsgCode

public abstract java.lang.Integer getEpsgCode()
Returns:
The EPSG Code of this CRS, null if it doesn't have one.

toCode

public java.lang.String toCode()
Default implementation of toCode(). Should be overridden, if there is no EPSG code for this CRS.

Specified by:
toCode in interface Projection

convertMinuteSecond

protected static final double convertMinuteSecond(double minute,
                                                  double second)

convertDegreeMinuteSecond

protected static final double convertDegreeMinuteSecond(double degree,
                                                        double minute,
                                                        double second)

dump

public void dump()


JOSM