Class TileAnchor
java.lang.Object
org.openstreetmap.josm.gui.layer.imagery.TileAnchor
Class that fixes the position of a tile in a given coordinate space.
This is done by storing the coordinates of the tile origin and the opposite
tile corner.
It may represent a reprojected tile, i.e. the tile is rotated / deformed in an arbitrary way. In general, the tile origin cannot be expected to be the upper left corner of the rectangle that is spanned by the 2 points.
The coordinate space may be
- pixel coordinates of the image file
- projected coordinates (east / north)
- screen pixel coordinates
- Since:
- 11846
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTileAnchor(Point2D tileOrigin, Point2D nextTileOrigin) Create a new tile anchor.TileAnchor(org.openstreetmap.gui.jmapviewer.interfaces.IProjected tileOrigin, org.openstreetmap.gui.jmapviewer.interfaces.IProjected nextTileOrigin) Constructs a newTileAnchor. -
Method Summary
Modifier and TypeMethodDescriptionconvert(TileAnchor other) Create a transformation that converts points from this coordinate space to another coordinate space.Returns the position of the opposite tile corner.Returns the position of the tile origin.toString()
-
Field Details
-
tileOrigin
-
nextTileOrigin
-
-
Constructor Details
-
TileAnchor
Create a new tile anchor.- Parameters:
tileOrigin- position of the tile originnextTileOrigin- position of the opposite tile corner, i.e. the origin of the tile with index (x+1,y+1), when current tile has index (x,y)
-
TileAnchor
public TileAnchor(org.openstreetmap.gui.jmapviewer.interfaces.IProjected tileOrigin, org.openstreetmap.gui.jmapviewer.interfaces.IProjected nextTileOrigin) Constructs a newTileAnchor.- Parameters:
tileOrigin- position of the tile originnextTileOrigin- position of the opposite tile corner, i.e. the origin of the tile with index (x+1,y+1), when current tile has index (x,y)
-
-
Method Details
-
getTileOrigin
Returns the position of the tile origin.- Returns:
- the position of the tile origin
-
getNextTileOrigin
Returns the position of the opposite tile corner.- Returns:
- the position of the opposite tile corner, i.e. the origin of the tile with index (x+1,y+1), when current tile has index (x,y)
-
toString
-
convert
Create a transformation that converts points from this coordinate space to another coordinate space.- Parameters:
other- tile anchor of the tile in the target coordinate space- Returns:
- affine transformation from this coordinate space to the target coordinate space
-