Package mil.nga.proj
Class ProjectionTransform
- java.lang.Object
-
- mil.nga.proj.ProjectionTransform
-
public class ProjectionTransform extends Object
Projection transform wrapper- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.locationtech.proj4j.CoordinateTransformFactory
ctFactory
Coordinate transform factoryprotected Projection
fromProjection
From Projectionprotected Projection
toProjection
To Projectionprotected org.locationtech.proj4j.CoordinateTransform
transform
Coordinate transform
-
Constructor Summary
Constructors Constructor Description ProjectionTransform(Projection fromProjection, Projection toProjection)
ConstructorProjectionTransform(ProjectionTransform transform)
Copy Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProjectionTransform
create(long fromEpsg, long toEpsg)
Create a projection transformstatic ProjectionTransform
create(long fromEpsg, Projection toProjection)
Create a projection transformstatic ProjectionTransform
create(String fromAuthority, long fromCode, String toAuthority, long toCode)
Create a projection transformstatic ProjectionTransform
create(String fromAuthority, long fromCode, Projection toProjection)
Create a projection transformstatic ProjectionTransform
create(String fromAuthority, String fromCode, String toAuthority, String toCode)
Create a projection transformstatic ProjectionTransform
create(String fromAuthority, String fromCode, Projection toProjection)
Create a projection transformstatic ProjectionTransform
create(Projection fromProjection, long toEpsg)
Create a projection transformstatic ProjectionTransform
create(Projection fromProjection, String toAuthority, long toCode)
Create a projection transformstatic ProjectionTransform
create(Projection fromProjection, String toAuthority, String toCode)
Create a projection transformstatic ProjectionTransform
create(Projection fromProjection, Projection toProjection)
Create a projection transformstatic ProjectionTransform
create(ProjectionTransform transform)
Create a projection transformProjection
getFromProjection()
Get the from projection in the transformProjectionTransform
getInverseTransformation()
Get the inverse transformationProjection
getToProjection()
Get the to projection in the transformorg.locationtech.proj4j.CoordinateTransform
getTransform()
Get the transformboolean
isSameProjection()
Is the from and to projection the same?double[]
transform(double x, double y)
Transform a x and y locationdouble[]
transform(double minX, double minY, double maxX, double maxY)
Transform the coordinate boundsorg.locationtech.proj4j.ProjCoordinate
transform(org.locationtech.proj4j.ProjCoordinate from)
Transform the projected coordinate
-
-
-
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 projectiontoProjection
- 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 projectiontoProjection
- to projection- Returns:
- projection transform
-
create
public static ProjectionTransform create(Projection fromProjection, long toEpsg)
Create a projection transform- Parameters:
fromProjection
- from projectiontoEpsg
- to epsg- Returns:
- projection transform
-
create
public static ProjectionTransform create(Projection fromProjection, String toAuthority, long toCode)
Create a projection transform- Parameters:
fromProjection
- from projectiontoAuthority
- to coordinate authoritytoCode
- to coordinate code- Returns:
- projection transform
-
create
public static ProjectionTransform create(Projection fromProjection, String toAuthority, String toCode)
Create a projection transform- Parameters:
fromProjection
- from projectiontoAuthority
- to coordinate authoritytoCode
- to coordinate code- Returns:
- projection transform
-
create
public static ProjectionTransform create(long fromEpsg, Projection toProjection)
Create a projection transform- Parameters:
fromEpsg
- from epsgtoProjection
- to projection- Returns:
- projection transform
-
create
public static ProjectionTransform create(String fromAuthority, long fromCode, Projection toProjection)
Create a projection transform- Parameters:
fromAuthority
- from coordinate authorityfromCode
- from coordinate codetoProjection
- to projection- Returns:
- projection transform
-
create
public static ProjectionTransform create(String fromAuthority, String fromCode, Projection toProjection)
Create a projection transform- Parameters:
fromAuthority
- from coordinate authorityfromCode
- from coordinate codetoProjection
- to projection- Returns:
- projection transform
-
create
public static ProjectionTransform create(long fromEpsg, long toEpsg)
Create a projection transform- Parameters:
fromEpsg
- from epsgtoEpsg
- 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 authorityfromCode
- from coordinate codetoAuthority
- to coordinate authoritytoCode
- 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 authorityfromCode
- from coordinate codetoAuthority
- to coordinate authoritytoCode
- 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 coordinatey
- 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 xminY
- min ymaxX
- max xmaxY
- 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
-
-