source: josm/trunk/src/org/openstreetmap/josm/data/projection/Projecting.java@ 12134

Last change on this file since 12134 was 10805, checked in by Don-vip, 8 years ago

fix #13287 - Projection updates to support multiple projections (patch by michael2402) - gsoc-core

  • 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;
3
4import java.util.Map;
5
6import org.openstreetmap.josm.data.ProjectionBounds;
7import org.openstreetmap.josm.data.coor.EastNorth;
8import org.openstreetmap.josm.data.coor.LatLon;
9
10/**
11 * Classes implementing this are able to project between screen (east/north) and {@link LatLon} coordinates.
12 * <p>
13 * Each instance is backed by a base projection but may e.g. offset the resulting position.
14 * @author Michael Zangl
15 * @since 10805
16 */
17public interface Projecting {
18
19 /**
20 * Convert from lat/lon to easting/northing.
21 *
22 * @param ll the geographical point to convert (in WGS84 lat/lon)
23 * @return the corresponding east/north coordinates
24 */
25 EastNorth latlon2eastNorth(LatLon ll);
26
27 /**
28 * Convert a east/north coordinate to the {@link LatLon} coordinate.
29 * This method clamps the lat/lon coordinate to the nearest point in the world bounds.
30 * @param en east/north
31 * @return The lat/lon coordinate.
32 */
33 LatLon eastNorth2latlonClamped(EastNorth en);
34
35 /**
36 * Gets the base projection instance used.
37 * @return The projection.
38 */
39 Projection getBaseProjection();
40
41 /**
42 * Returns an map or (subarea, projecting) paris that contains projecting instances to convert the coordinates inside the given area.
43 * This can be used by projections to support continuous projections.
44 *
45 * It is possible that the area covered by the map is bigger than the one given as area. There may be holes.
46 * @param area The base area
47 * @return a map of non-overlapping {@link ProjectionBounds} instances mapped to the {@link Projecting} object to use for that area.
48 */
49 Map<ProjectionBounds, Projecting> getProjectingsForArea(ProjectionBounds area);
50}
Note: See TracBrowser for help on using the repository browser.