Class PlateCarreProjection

  • All Implemented Interfaces:
    Projection

    public class PlateCarreProjection
    extends java.lang.Object
    implements Projection
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getImageHeight()  
      double getImageWidth()  
      int latitudeToPixelY​(float latitude)
      Project the given latitude on the image.
      int longitudeToPixelX​(float longitude)
      Project the given longitude on the image.
      float pixelXToLongitude​(double px)
      Retrieve the longitude associated to the given projected point.
      float pixelYToLatitude​(double py)
      Retrieve the latitude associated to the given projected point.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PlateCarreProjection

        public PlateCarreProjection​(GraphStatistics.BoundingBox boundingBox,
                                    int maxSize)
        Create a new PlateCarreProjection corresponding to the given BoundingBox and maxSize.
        Parameters:
        boundingBox - Box for this projection.
        maxSize - Maximum size of any side (width / height) of the image to which this projection should draw.
    • Method Detail

      • getImageWidth

        public double getImageWidth()
        Specified by:
        getImageWidth in interface Projection
        Returns:
        Image width for this projection to work properly.
      • getImageHeight

        public double getImageHeight()
        Specified by:
        getImageHeight in interface Projection
        Returns:
        Image weight for this projection to work properly.
      • latitudeToPixelY

        public int latitudeToPixelY​(float latitude)
        Description copied from interface: Projection
        Project the given latitude on the image.
        Specified by:
        latitudeToPixelY in interface Projection
        Parameters:
        latitude - Latitude to project.
        Returns:
        Projected position of the latitude on the image.
      • longitudeToPixelX

        public int longitudeToPixelX​(float longitude)
        Description copied from interface: Projection
        Project the given longitude on the image.
        Specified by:
        longitudeToPixelX in interface Projection
        Parameters:
        longitude - Longitude to project.
        Returns:
        Projected position of the longitude on the image.
      • pixelYToLatitude

        public float pixelYToLatitude​(double py)
        Description copied from interface: Projection
        Retrieve the latitude associated to the given projected point.
        Specified by:
        pixelYToLatitude in interface Projection
        Parameters:
        py - Projected y-position for which latitude should be retrieved.
        Returns:
        The original latitude of the point.
      • pixelXToLongitude

        public float pixelXToLongitude​(double px)
        Description copied from interface: Projection
        Retrieve the longitude associated to the given projected point.
        Specified by:
        pixelXToLongitude in interface Projection
        Parameters:
        px - Projected x-position for which longitude should be retrieved.
        Returns:
        The original longitude of the point.