Class ScaleProjectionTransform
java.lang.Object
net.buildtheearth.terraminusminus.projection.transform.ProjectionTransform
net.buildtheearth.terraminusminus.projection.transform.ScaleProjectionTransform
- All Implemented Interfaces:
GeographicProjection
Scales the warps projection's projected space up or down.
More specifically, it multiplies x and y by there respective scale factors.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.buildtheearth.terraminusminus.projection.GeographicProjection
GeographicProjection.Deserializer, GeographicProjection.Serializer -
Field Summary
Fields inherited from class net.buildtheearth.terraminusminus.projection.transform.ProjectionTransform
delegate -
Constructor Summary
ConstructorsConstructorDescriptionScaleProjectionTransform(GeographicProjection delegate, double x, double y) Creates a new ScaleProjection with different scale factors for the x and y axis. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]bounds()Indicates the minimum and maximum X and Y coordinates on the projected space.double[]fromGeo(double lon, double lat) Converts geographic coordinates to map coordinatesdoubleGives an estimation of the scale of this projection.double[]toGeo(double x, double y) Converts map coordinates to geographic coordinatestoString()booleanupright()Indicates whether or not the north pole is projected to the north of the south pole on the projected space, assuming Minecraft's coordinate system cardinal directions for the projected space (north is negative Z).doublex()doubley()Methods inherited from class net.buildtheearth.terraminusminus.projection.transform.ProjectionTransform
delegateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.buildtheearth.terraminusminus.projection.GeographicProjection
azimuth, azimuth, properties, tissot, tissot, vector
-
Constructor Details
-
ScaleProjectionTransform
Creates a new ScaleProjection with different scale factors for the x and y axis.- Parameters:
delegate- - projection to transformx- - scaling to apply along the x axisy- - scaling to apply along the y axis
-
-
Method Details
-
toGeo
Description copied from interface:GeographicProjectionConverts map coordinates to geographic coordinates- Parameters:
x- - x map coordinatey- - y map coordinate- Returns:
- {longitude, latitude} in degrees
- Throws:
OutOfProjectionBoundsException- if the specified point on the projected space cannot be mapped to a point of the geographic space
-
fromGeo
Description copied from interface:GeographicProjectionConverts geographic coordinates to map coordinates- Parameters:
lon- - longitude, in degreeslat- - latitude, in degrees- Returns:
- {x, y} map coordinates
- Throws:
OutOfProjectionBoundsException- if the specified point on the geographic space cannot be mapped to a point of the projected space
-
upright
public boolean upright()Description copied from interface:GeographicProjectionIndicates whether or not the north pole is projected to the north of the south pole on the projected space, assuming Minecraft's coordinate system cardinal directions for the projected space (north is negative Z).- Specified by:
uprightin interfaceGeographicProjection- Overrides:
uprightin classProjectionTransform- Returns:
- north pole Z <= south pole Z
-
bounds
public double[] bounds()Description copied from interface:GeographicProjectionIndicates the minimum and maximum X and Y coordinates on the projected space.- Specified by:
boundsin interfaceGeographicProjection- Overrides:
boundsin classProjectionTransform- Returns:
- {minimum X, minimum Y, maximum X, maximum Y}
-
metersPerUnit
public double metersPerUnit()Description copied from interface:GeographicProjectionGives an estimation of the scale of this projection. This is just an estimation, as distortion is inevitable when projecting a sphere onto a flat surface, so this value varies from places to places in reality.- Specified by:
metersPerUnitin interfaceGeographicProjection- Overrides:
metersPerUnitin classProjectionTransform- Returns:
- an estimation of the scale of this projection
-
toString
-
x
public double x() -
y
public double y()
-