Package mil.nga.proj

Class ProjectionTransform


  • public class ProjectionTransform
    extends Object
    Projection transform wrapper
    Author:
    osbornb
    • Field Detail

      • ctFactory

        protected static org.locationtech.proj4j.CoordinateTransformFactory ctFactory
        Coordinate transform factory
      • fromProjection

        protected final Projection fromProjection
        From Projection
      • toProjection

        protected final Projection toProjection
        To Projection
      • transform

        protected final org.locationtech.proj4j.CoordinateTransform transform
        Coordinate transform
    • Constructor Detail

      • ProjectionTransform

        public ProjectionTransform​(Projection fromProjection,
                                   Projection toProjection)
        Constructor
        Parameters:
        fromProjection - from projection
        toProjection - to projection
      • ProjectionTransform

        public ProjectionTransform​(ProjectionTransform transform)
        Copy Constructor
        Parameters:
        transform - projection transform
    • Method Detail

      • create

        public static ProjectionTransform create​(Projection fromProjection,
                                                 Projection toProjection)
        Create a projection transform
        Parameters:
        fromProjection - from projection
        toProjection - to projection
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(Projection fromProjection,
                                                 long toEpsg)
        Create a projection transform
        Parameters:
        fromProjection - from projection
        toEpsg - to epsg
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(Projection fromProjection,
                                                 String toAuthority,
                                                 long toCode)
        Create a projection transform
        Parameters:
        fromProjection - from projection
        toAuthority - to coordinate authority
        toCode - to coordinate code
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(Projection fromProjection,
                                                 String toAuthority,
                                                 String toCode)
        Create a projection transform
        Parameters:
        fromProjection - from projection
        toAuthority - to coordinate authority
        toCode - to coordinate code
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(long fromEpsg,
                                                 Projection toProjection)
        Create a projection transform
        Parameters:
        fromEpsg - from epsg
        toProjection - to projection
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(String fromAuthority,
                                                 long fromCode,
                                                 Projection toProjection)
        Create a projection transform
        Parameters:
        fromAuthority - from coordinate authority
        fromCode - from coordinate code
        toProjection - to projection
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(String fromAuthority,
                                                 String fromCode,
                                                 Projection toProjection)
        Create a projection transform
        Parameters:
        fromAuthority - from coordinate authority
        fromCode - from coordinate code
        toProjection - to projection
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(long fromEpsg,
                                                 long toEpsg)
        Create a projection transform
        Parameters:
        fromEpsg - from epsg
        toEpsg - to epsg
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(String fromAuthority,
                                                 long fromCode,
                                                 String toAuthority,
                                                 long toCode)
        Create a projection transform
        Parameters:
        fromAuthority - from coordinate authority
        fromCode - from coordinate code
        toAuthority - to coordinate authority
        toCode - to coordinate code
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(String fromAuthority,
                                                 String fromCode,
                                                 String toAuthority,
                                                 String toCode)
        Create a projection transform
        Parameters:
        fromAuthority - from coordinate authority
        fromCode - from coordinate code
        toAuthority - to coordinate authority
        toCode - to coordinate code
        Returns:
        projection transform
      • create

        public static ProjectionTransform create​(ProjectionTransform transform)
        Create a projection transform
        Parameters:
        transform - projection transform
        Returns:
        projection transform
      • transform

        public org.locationtech.proj4j.ProjCoordinate transform​(org.locationtech.proj4j.ProjCoordinate from)
        Transform the projected coordinate
        Parameters:
        from - from coordinate
        Returns:
        to coordinate
      • transform

        public double[] transform​(double x,
                                  double y)
        Transform a x and y location
        Parameters:
        x - x coordinate
        y - y coordinate
        Returns:
        transformed coordinates as [x, y]
      • transform

        public double[] transform​(double minX,
                                  double minY,
                                  double maxX,
                                  double maxY)
        Transform the coordinate bounds
        Parameters:
        minX - min x
        minY - min y
        maxX - max x
        maxY - max y
        Returns:
        transformed coordinate bounds as [minX, minY, maxX, maxY]
      • getFromProjection

        public Projection getFromProjection()
        Get the from projection in the transform
        Returns:
        from projection
      • getToProjection

        public Projection getToProjection()
        Get the to projection in the transform
        Returns:
        to projection
      • getTransform

        public org.locationtech.proj4j.CoordinateTransform getTransform()
        Get the transform
        Returns:
        transform
      • isSameProjection

        public boolean isSameProjection()
        Is the from and to projection the same?
        Returns:
        true if the same projection
      • getInverseTransformation

        public ProjectionTransform getInverseTransformation()
        Get the inverse transformation
        Returns:
        inverse transformation