org.openstreetmap.josm.data.projection.proj
Interface Proj

All Known Implementing Classes:
LambertConformalConic, LonLat, Mercator, SwissObliqueMercator, TransverseMercator

public interface Proj

A projection (in the narrow sense). Converts lat/lon the east/north and the other way around. Datum conversion, false easting / northing, origin of longitude and general scale factor is already applied when the projection is invoked. Lat/lon is not in degrees, but in radians (unlike other parts of JOSM). Additional parameters in the constructor arguments are usually still in degrees. So to avoid confusion, you can follow the convention, that coordinates in radians are called lat_rad/lon_rad or phi/lambda. East/north values are not in meters, but in meters divided by the semi major axis of the ellipsoid (earth radius). (Usually this is what you get anyway, unless you multiply by 'a' somehow implicitly or explicitly.)


Method Summary
 java.lang.String getName()
          A Human readable name of this projection.
 java.lang.String getProj4Id()
          The Proj.4 identifier.
 void initialize(ProjParameters params)
          Initialize the projection using the provided parameters.
 double[] invproject(double east, double north)
          Convert east/north to lat/lon.
 double[] project(double lat_rad, double lon_rad)
          Convert lat/lon to east/north.
 

Method Detail

getName

java.lang.String getName()
A Human readable name of this projection.


getProj4Id

java.lang.String getProj4Id()
The Proj.4 identifier. (as reported by cs2cs -lp) If no id exists, return null.


initialize

void initialize(ProjParameters params)
                throws ProjectionConfigurationException
Initialize the projection using the provided parameters.

Throws:
ProjectionConfigurationException - in case parameters are not suitable

project

double[] project(double lat_rad,
                 double lon_rad)
Convert lat/lon to east/north.

Parameters:
lat_rad - the latitude in radians
lon_rad - the longitude in radians
Returns:
array of length 2, containing east and north value in meters, divided by the semi major axis of the ellipsoid.

invproject

double[] invproject(double east,
                    double north)
Convert east/north to lat/lon.

Parameters:
east - east value in meters, divided by the semi major axis of the ellipsoid
north - north value in meters, divided by the semi major axis of the ellipsoid
Returns:
array of length 2, containing lat and lon in radians.


JOSM