source: josm/trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java@ 4382

Last change on this file since 4382 was 4285, checked in by bastiK, 13 years ago

major projection rework

More modular structure, inspired by Proj.4.

There are almost no semantic changes to the projection algorithms. Mostly factors of 'a' and 180/PI have been moved from one place to the other. In UTM_France_DOM, the ellipsoid conversion for the first 3 projections has been changed from hayford <-> GRS80 to hayford <-> WGS84.

Some redundant algorithms have been removed. In particular:

  • UTM_France_DOM used to have its own Transverse Mercator implementation. It is different from the implementation in TransverseMercator.java as it has another series expansion. For EPSG::2975, there are numeric differences on centimeter scale. However, the new data fits better with Proj.4 output.
  • Also removed are alternate implementations of LambertConformalConic. (They are all quite similar, though.)
  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection.proj;
3
4/**
5 * A projection (in the narrow sense).
6 *
7 * Converts lat/lon the east/north and the other way around.
8 *
9 * Datum conversion, false easting / northing, origin of longitude
10 * and general scale factor is already applied when the projection is invoked.
11 *
12 * Lat/lon is not in degrees, but in radians (unlike other parts of JOSM).
13 * Additional parameters in the constructor arguments are usually still in
14 * degrees. So to avoid confusion, you can follow the convention, that
15 * coordinates in radians are called lat_rad/lon_rad or phi/lambda.
16 *
17 * East/north values are not in meters, but in meters divided by the semi major
18 * axis of the ellipsoid (earth radius). (Usually this is what you get anyway,
19 * unless you multiply by 'a' somehow implicitly or explicitly.)
20 *
21 */
22public interface Proj {
23 /**
24 * A Human readable name of this projection.
25 */
26 String getName();
27
28 /**
29 * The Proj.4 identifier.
30 *
31 * (as reported by cs2cs -lp)
32 * If no id exists, return null.
33 */
34 String getProj4Id();
35
36 /**
37 * Convert lat/lon to east/north.
38 *
39 * @param lat_rad the latitude in radians
40 * @param lon_rad the longitude in radians
41 * @return array of length 2, containing east and north value in meters,
42 * divided by the semi major axis of the ellipsoid.
43 */
44 double[] project(double lat_rad, double lon_rad);
45
46 /**
47 * Convert east/north to lat/lon.
48 *
49 * @param east east value in meters, divided by the semi major axis of the ellipsoid
50 * @param north north value in meters, divided by the semi major axis of the ellipsoid
51 * @return array of length 2, containing lat and lon in radians.
52 */
53 double[] invproject(double east, double north);
54}
Note: See TracBrowser for help on using the repository browser.