Class MercatorUtils

java.lang.Object
org.jxmapviewer.viewer.util.MercatorUtils

public final class MercatorUtils
extends java.lang.Object
A utility class of methods that help when dealing with standard Mercator projections.
  • Method Summary

    Modifier and Type Method Description
    static int latToY​(double latitudeDegrees, double radius)  
    static int longToX​(double longitudeDegrees, double radius)  
    static double xToLong​(int x, double radius)  
    static double yToLat​(int y, double radius)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • longToX

      public static int longToX​(double longitudeDegrees, double radius)
      Parameters:
      longitudeDegrees - the longitude in degrees
      radius - the world radius in pixels
      Returns:
      the x value
    • latToY

      public static int latToY​(double latitudeDegrees, double radius)
      Parameters:
      latitudeDegrees - the latitude in degrees
      radius - the world radius in pixels
      Returns:
      the y value
    • xToLong

      public static double xToLong​(int x, double radius)
      Parameters:
      x - the x value
      radius - the world radius in pixels
      Returns:
      the longitude in degrees
    • yToLat

      public static double yToLat​(int y, double radius)
      Parameters:
      y - the y value
      radius - the world radius in pixels
      Returns:
      the latitude in degrees