[5548] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
[1] | 2 | package org.openstreetmap.josm.data.projection;
|
---|
| 3 |
|
---|
[2017] | 4 | import org.openstreetmap.josm.data.Bounds;
|
---|
[99] | 5 | import org.openstreetmap.josm.data.coor.EastNorth;
|
---|
[71] | 6 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
[1] | 7 |
|
---|
| 8 | /**
|
---|
[5548] | 9 | * A projection, i.e. a class that supports conversion from lat/lon
|
---|
| 10 | * to east/north and back.
|
---|
[1169] | 11 | *
|
---|
[5548] | 12 | * The conversion from east/north to the screen coordinates is simply a scale
|
---|
| 13 | * factor and x/y offset.
|
---|
[1] | 14 | */
|
---|
[43] | 15 | public interface Projection {
|
---|
[1169] | 16 | /**
|
---|
[5903] | 17 | * The default scale factor in east/north units per pixel
|
---|
| 18 | * ({@link org.openstreetmap.josm.gui.NavigatableComponent#scale})).
|
---|
[4305] | 19 | * FIXME: misnomer
|
---|
[5548] | 20 | * @return the scale factor
|
---|
[2114] | 21 | */
|
---|
| 22 | double getDefaultZoomInPPD();
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
[5548] | 25 | * Convert from lat/lon to easting/northing.
|
---|
[1169] | 26 | *
|
---|
[5548] | 27 | * @param ll the geographical point to convert (in WGS84 lat/lon)
|
---|
| 28 | * @return the corresponding east/north coordinates
|
---|
[1169] | 29 | */
|
---|
[5548] | 30 | EastNorth latlon2eastNorth(LatLon ll);
|
---|
[1169] | 31 |
|
---|
| 32 | /**
|
---|
[5548] | 33 | * Convert from easting/norting to lat/lon.
|
---|
[1169] | 34 | *
|
---|
[5548] | 35 | * @param en the geographical point to convert (in projected coordinates)
|
---|
| 36 | * @return the corresponding lat/lon (WGS84)
|
---|
[1169] | 37 | */
|
---|
[5548] | 38 | LatLon eastNorth2latlon(EastNorth en);
|
---|
[1169] | 39 |
|
---|
| 40 | /**
|
---|
[5548] | 41 | * Describe the projection in one or two words.
|
---|
| 42 | * @return the name / description
|
---|
[1169] | 43 | */
|
---|
| 44 | String toString();
|
---|
| 45 |
|
---|
| 46 | /**
|
---|
[5548] | 47 | * Return projection code.
|
---|
| 48 | *
|
---|
| 49 | * This should be a unique identifier.
|
---|
[4288] | 50 | * If projection supports parameters, return a different code
|
---|
| 51 | * for each set of parameters.
|
---|
[6069] | 52 | *
|
---|
[4288] | 53 | * The EPSG code can be used (if defined for the projection).
|
---|
[5548] | 54 | *
|
---|
| 55 | * @return the projection identifier
|
---|
[1309] | 56 | */
|
---|
| 57 | String toCode();
|
---|
| 58 |
|
---|
| 59 | /**
|
---|
[5548] | 60 | * Get a filename compatible string (for the cache directory).
|
---|
| 61 | * @return the cache directory name (base name)
|
---|
[79] | 62 | */
|
---|
| 63 | String getCacheDirectoryName();
|
---|
[1169] | 64 |
|
---|
[116] | 65 | /**
|
---|
[5548] | 66 | * Get the bounds of the world.
|
---|
| 67 | * @return the supported lat/lon rectangle for this projection
|
---|
[116] | 68 | */
|
---|
[1722] | 69 | Bounds getWorldBoundsLatLon();
|
---|
[1] | 70 | }
|
---|