1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package 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 | */
|
---|
22 | public 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 | }
|
---|