Class ShiftedProjecting
- java.lang.Object
-
- org.openstreetmap.josm.data.projection.ShiftedProjecting
-
- All Implemented Interfaces:
Projecting
public class ShiftedProjecting extends java.lang.Object implements Projecting
This is a projecting instance that shifts the projection by a given eastnorth offset.- Since:
- 10805
-
-
Field Summary
Fields Modifier and Type Field Description private Projecting
base
private EastNorth
offset
-
Constructor Summary
Constructors Constructor Description ShiftedProjecting(Projecting base, EastNorth offset)
Create a newShiftedProjecting
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LatLon
eastNorth2latlonClamped(EastNorth en)
Convert a east/north coordinate to theLatLon
coordinate.Projection
getBaseProjection()
Gets the base projection instance used.java.util.Map<ProjectionBounds,Projecting>
getProjectingsForArea(ProjectionBounds area)
Returns an map or (subarea, projecting) paris that contains projecting instances to convert the coordinates inside the given area.EastNorth
latlon2eastNorth(ILatLon ll)
Convert from lat/lon to easting/northing.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.projection.Projecting
getCacheKey, latlon2eastNorth
-
-
-
-
Field Detail
-
base
private final Projecting base
-
-
Constructor Detail
-
ShiftedProjecting
public ShiftedProjecting(Projecting base, EastNorth offset)
Create a newShiftedProjecting
- Parameters:
base
- The base to useoffset
- The offset to move base. Subtracted when converting lat/lon → east/north.
-
-
Method Detail
-
latlon2eastNorth
public EastNorth latlon2eastNorth(ILatLon ll)
Description copied from interface:Projecting
Convert from lat/lon to easting/northing. This method uses the newerILatLon
interface.- Specified by:
latlon2eastNorth
in interfaceProjecting
- Parameters:
ll
- the geographical point to convert (in WGS84 lat/lon)- Returns:
- the corresponding east/north coordinates
- See Also:
as shorthand.
-
eastNorth2latlonClamped
public LatLon eastNorth2latlonClamped(EastNorth en)
Description copied from interface:Projecting
Convert a east/north coordinate to theLatLon
coordinate. This method clamps the lat/lon coordinate to the nearest point in the world bounds.- Specified by:
eastNorth2latlonClamped
in interfaceProjecting
- Parameters:
en
- east/north- Returns:
- The lat/lon coordinate.
-
getBaseProjection
public Projection getBaseProjection()
Description copied from interface:Projecting
Gets the base projection instance used. This may be the same as this one or a different one if this one is translated in east/north space.- Specified by:
getBaseProjection
in interfaceProjecting
- Returns:
- The projection.
-
getProjectingsForArea
public java.util.Map<ProjectionBounds,Projecting> getProjectingsForArea(ProjectionBounds area)
Description copied from interface:Projecting
Returns an map or (subarea, projecting) paris that contains projecting instances to convert the coordinates inside the given area. This can be used by projections to support continuous projections. It is possible that the area covered by the map is bigger than the one given as area. There may be holes.- Specified by:
getProjectingsForArea
in interfaceProjecting
- Parameters:
area
- The base area- Returns:
- a map of non-overlapping
ProjectionBounds
instances mapped to theProjecting
object to use for that area.
-
-