Class MercatorProjection

java.lang.Object
it.tidalwave.mapviewer.spi.MercatorProjection
All Implemented Interfaces:
Projection

public class MercatorProjection extends Object implements Projection
An implementation of the Mercator Projection.
Author:
Fabrizio Giudici
  • Constructor Details

    • MercatorProjection

      public MercatorProjection()
  • Method Details

    • coordinatesToMapPoint

      @Nonnull public MapPoint coordinatesToMapPoint(@Nonnull MapCoordinates coordinates, double zoomLevel)
      Returns a MapPoint converted from the given coordinates and zoom level..
      Specified by:
      coordinatesToMapPoint in interface Projection
      Parameters:
      coordinates - the coordinates to convert
      zoomLevel - the zoom level
      Returns:
      a MapPoint converted from the given coordinates and zoom level
    • mapPointToCoordinates

      @Nonnull public MapCoordinates mapPointToCoordinates(@Nonnull MapPoint mapPoint, double zoomLevel)
      Returns MapCoordinates converted from the point coordinates and zoom level..
      Specified by:
      mapPointToCoordinates in interface Projection
      Parameters:
      mapPoint - the point
      zoomLevel - the zoom level
      Returns:
      MapCoordinates converted from the point coordinates and zoom level
    • metersPerPixel

      public final double metersPerPixel(@Nonnull MapCoordinates coordinates, double zoomLevel)
      Returns the map scale (expressed in meters per pixel) at the given zoom level..
      Specified by:
      metersPerPixel in interface Projection
      Parameters:
      coordinates - coordinates
      zoomLevel - the zoom level
      Returns:
      the map scale (expressed in meters per pixel) at the given zoom level