Class ScaleProjectionTransform

java.lang.Object
net.buildtheearth.terraminusminus.projection.transform.ProjectionTransform
net.buildtheearth.terraminusminus.projection.transform.ScaleProjectionTransform
All Implemented Interfaces:
GeographicProjection

public class ScaleProjectionTransform extends ProjectionTransform
Scales the warps projection's projected space up or down. More specifically, it multiplies x and y by there respective scale factors.
  • Constructor Details

    • ScaleProjectionTransform

      public ScaleProjectionTransform(GeographicProjection delegate, double x, double y)
      Creates a new ScaleProjection with different scale factors for the x and y axis.
      Parameters:
      delegate - - projection to transform
      x - - scaling to apply along the x axis
      y - - scaling to apply along the y axis
  • Method Details

    • toGeo

      public double[] toGeo(double x, double y) throws OutOfProjectionBoundsException
      Description copied from interface: GeographicProjection
      Converts map coordinates to geographic coordinates
      Parameters:
      x - - x map coordinate
      y - - 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

      public double[] fromGeo(double lon, double lat) throws OutOfProjectionBoundsException
      Description copied from interface: GeographicProjection
      Converts geographic coordinates to map coordinates
      Parameters:
      lon - - longitude, in degrees
      lat - - 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: GeographicProjection
      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).
      Specified by:
      upright in interface GeographicProjection
      Overrides:
      upright in class ProjectionTransform
      Returns:
      north pole Z <= south pole Z
    • bounds

      public double[] bounds()
      Description copied from interface: GeographicProjection
      Indicates the minimum and maximum X and Y coordinates on the projected space.
      Specified by:
      bounds in interface GeographicProjection
      Overrides:
      bounds in class ProjectionTransform
      Returns:
      {minimum X, minimum Y, maximum X, maximum Y}
    • metersPerUnit

      public double metersPerUnit()
      Description copied from interface: GeographicProjection
      Gives 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:
      metersPerUnit in interface GeographicProjection
      Overrides:
      metersPerUnit in class ProjectionTransform
      Returns:
      an estimation of the scale of this projection
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • x

      public double x()
    • y

      public double y()