|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree_impl.model.ct.CoordinateTransformationFactory
Creates coordinate transformations.
CT_CoordinateTransformationFactory
Nested Class Summary | |
private class |
CoordinateTransformationFactory.Export
Wrap a CoordinateTransformationFactory for use
with OpenGIS. |
Field Summary | |
private static CoordinateTransformationFactory |
DEFAULT
The default coordinate transformation factory. |
private MathTransformFactory |
factory
The underlying math transform factory. |
private static int |
temporaryID
Number for temporary created objects. |
Constructor Summary | |
CoordinateTransformationFactory(MathTransformFactory factory)
Construct a coordinate transformation factory. |
Method Summary | |
private CoordinateTransformation |
concatenate(CoordinateTransformation step1,
CoordinateTransformation step2)
Concatenate two transformation steps. |
private CoordinateTransformation |
concatenate(CoordinateTransformation step1,
CoordinateTransformation step2,
CoordinateTransformation step3)
Concatenate three transformation steps. |
CoordinateTransformation |
createFromCoordinateSystems(CoordinateSystem sourceCS,
CoordinateSystem targetCS)
Creates a transformation between two coordinate systems. |
private static CoordinateTransformation |
createFromMathTransform(CoordinateSystem sourceCS,
CoordinateSystem targetCS,
TransformType type,
MathTransform transform)
Create a coordinate transform from a math transform. |
protected CoordinateTransformation |
createTransformationStep(CompoundCoordinateSystem sourceCS,
CompoundCoordinateSystem targetCS)
Creates a transformation between two compound coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(CompoundCoordinateSystem sourceCS,
GeocentricCoordinateSystem targetCS)
Creates a transformation between a compound and a geocentric coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(GeocentricCoordinateSystem sourceCS,
GeocentricCoordinateSystem targetCS)
Creates a transformation between two geocentric coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(GeographicCoordinateSystem sourceCS,
GeocentricCoordinateSystem targetCS)
Creates a transformation between a geographic and a geocentric coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(GeographicCoordinateSystem sourceCS,
GeographicCoordinateSystem targetCS)
Creates a transformation between two geographic coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(GeographicCoordinateSystem sourceCS,
ProjectedCoordinateSystem targetCS)
Creates a transformation between a geographic and a projected coordinate systems. |
private CoordinateTransformation |
createTransformationStep(ProjectedCoordinateSystem sourceCS,
GeocentricCoordinateSystem targetCS)
Creates a transformation between a projected and a geocentric coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(ProjectedCoordinateSystem sourceCS,
GeographicCoordinateSystem targetCS)
Creates a transformation between a projected and a geographic coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(ProjectedCoordinateSystem sourceCS,
ProjectedCoordinateSystem targetCS)
Creates a transformation between two projected coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(TemporalCoordinateSystem sourceCS,
TemporalCoordinateSystem targetCS)
Creates a transformation between two temporal coordinate systems. |
protected CoordinateTransformation |
createTransformationStep(VerticalCoordinateSystem sourceCS,
VerticalCoordinateSystem targetCS)
Creates a transformation between two vertical coordinate systems. |
private static AxisOrientation[] |
getAxisOrientations(CoordinateSystem cs,
Dimensioned dim)
Returns the axis orientation for the specified coordinate system. |
static CoordinateTransformationFactory |
getDefault()
Returns the default coordinate transformation factory. |
private MathTransform |
getGeocentricTransform(java.lang.String classification,
int dimGeoCS,
Ellipsoid ellipsoid)
Returns a transform between a geocentric coordinate system and an ellipsoid. |
private CoordinateTransformation |
getGeographicTransformation(CoordinateSystem CS)
Returns a transformation from CS to a geographic coordinate system.
|
MathTransformFactory |
getMathTransformFactory()
Returns the underlying math transform factory. |
private static java.lang.String |
getTemporaryName(CoordinateSystem source)
Returns a temporary name for generated objects. |
private static Matrix |
getWGS84Parameters(HorizontalDatum datum)
Returns the WGS84 parameters as an affine transform, or null if not available. |
private static boolean |
hasStandardAxis(HorizontalCoordinateSystem cs,
Unit unit)
Returns true if the specified coordinate
system use standard axis and standard units. |
private static GeographicCoordinateSystem |
normalize(GeographicCoordinateSystem cs,
Projection projection)
Makes sure that the specified GeographicCoordinateSystem use standard axis
(longitude and latitude in degrees), Greenwich prime meridian and an ellipsoid
matching projection's parameters. |
private static ProjectedCoordinateSystem |
normalize(ProjectedCoordinateSystem cs)
Makes sure that a ProjectedCoordinateSystem use standard axis
(x and y in metres) and a normalized GeographicCoordinateSystem .
|
private Matrix |
swapAndScaleAxis(CoordinateSystem sourceCS,
CoordinateSystem targetCS)
Returns an affine transform between two coordinate systems. |
private Matrix |
swapAndScaleGeoAxis(GeographicCoordinateSystem sourceCS,
GeographicCoordinateSystem targetCS)
Returns an affine transform between two geographic coordinate systems. |
(package private) java.lang.Object |
toOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this transform factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static CoordinateTransformationFactory DEFAULT
private static volatile int temporaryID
getTemporaryName(org.deegree_impl.model.cs.CoordinateSystem)
is
invoked.
private final MathTransformFactory factory
Constructor Detail |
public CoordinateTransformationFactory(MathTransformFactory factory)
factory
- The math transform factory to use.Method Detail |
public static CoordinateTransformationFactory getDefault()
public final MathTransformFactory getMathTransformFactory()
MathTransform
objects for
all CoordinateTransformation
.
public CoordinateTransformation createFromCoordinateSystems(CoordinateSystem sourceCS, CoordinateSystem targetCS) throws CannotCreateTransformException
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(TemporalCoordinateSystem sourceCS, TemporalCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
. The default implementation checks if
both coordinate systems use the same datum, and then adjusts for axis
orientation, units and epoch.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(VerticalCoordinateSystem sourceCS, VerticalCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
. The default implementation checks if
both coordinate systems use the same datum, and then adjusts for axis
orientation and units.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(GeographicCoordinateSystem sourceCS, GeographicCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
. The default implementation can adjust
axis order and orientation (e.g. transforming from (NORTH,WEST)
to (EAST,NORTH)
), performs units conversion and apply Bursa Wolf
transformation if needed.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(ProjectedCoordinateSystem sourceCS, ProjectedCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
. The default implementation can adjust
axis order and orientation. It also performs units conversion if it
is the only extra change needed. Otherwise, it performs three steps:
sourceCS
.sourceCS.geographicCS
to targetCS.geographicCS
.targetCS
.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(GeographicCoordinateSystem sourceCS, ProjectedCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(ProjectedCoordinateSystem sourceCS, GeographicCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
. The default implementation returns
createTransformationStep
(targetCS, sourceCS).inverse()
.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(GeocentricCoordinateSystem sourceCS, GeocentricCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
. The default implementation can adjust
for axis order and orientation, adjust for prime meridian, performs units
conversion and apply Bursa Wolf transformation if needed.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(GeographicCoordinateSystem sourceCS, GeocentricCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
.
sourceCS
- Input geographic coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.private CoordinateTransformation createTransformationStep(ProjectedCoordinateSystem sourceCS, GeocentricCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
. This method doesn't need to be public since
its decomposition in two step should be general enough.
sourceCS
- Input projected coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(CompoundCoordinateSystem sourceCS, GeocentricCoordinateSystem targetCS) throws CannotCreateTransformException
HorizontalCoordinateSystem
VerticalCoordinateSystem
createFromCoordinateSystems(...)
.
sourceCS
- Input compound coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.protected CoordinateTransformation createTransformationStep(CompoundCoordinateSystem sourceCS, CompoundCoordinateSystem targetCS) throws CannotCreateTransformException
createFromCoordinateSystems(...)
.
sourceCS
- Input coordinate system.targetCS
- Output coordinate system.
sourceCS
to targetCS
.
CannotCreateTransformException
- if no transformation path has been found.private static Matrix getWGS84Parameters(HorizontalDatum datum)
null
if not available.
private MathTransform getGeocentricTransform(java.lang.String classification, int dimGeoCS, Ellipsoid ellipsoid)
classification
- either "Ellipsoid_To_Geocentric" or "Geocentric_To_Ellipsoid".dimGeoCS
- Dimension of the geographic coordinate system (2 or 3).ellipsoid
- The ellipsoid.
private CoordinateTransformation getGeographicTransformation(CoordinateSystem CS) throws CannotCreateTransformException
CS
to a geographic coordinate system.
If CS
is already an instance of {GeographicCoordinateSystem}, then
this method returns the identity transform. Otherwise, if CS
is an
instance of ProjectedCoordinateSystem
, then this method returns an inverse
map projection. Otherwise, this method returns null
.
CannotCreateTransformException
- if the transform can't be created.private CoordinateTransformation concatenate(CoordinateTransformation step1, CoordinateTransformation step2)
step1
- The first step, or null
for the identity transform.step2
- The second step, or null
for the identity transform.
null
if all arguments was nul.private CoordinateTransformation concatenate(CoordinateTransformation step1, CoordinateTransformation step2, CoordinateTransformation step3)
step1
- The first step, or null
for the identity transform.step2
- The second step, or null
for the identity transform.step3
- The third step, or null
for the identity transform.
null
if all arguments was nul.private static CoordinateTransformation createFromMathTransform(CoordinateSystem sourceCS, CoordinateSystem targetCS, TransformType type, MathTransform transform)
transform
is returned with
no change. Otherwise, a new coordinate transform is created.
sourceCS
- The source coordinate system.targetCS
- The destination coordinate system.type
- The transform type.transform
- The math transform.
private Matrix swapAndScaleAxis(CoordinateSystem sourceCS, CoordinateSystem targetCS) throws CannotCreateTransformException
sourceCS
- The source coordinate system. If null
, then
(x,y,z,t) axis order is assumed.targetCS
- The target coordinate system. If null
, then
(x,y,z,t) axis order is assumed.
CannotCreateTransformException
private Matrix swapAndScaleGeoAxis(GeographicCoordinateSystem sourceCS, GeographicCoordinateSystem targetCS) throws CannotCreateTransformException
sourceCS
- The source coordinate system.targetCS
- The target coordinate system.
CannotCreateTransformException
private static AxisOrientation[] getAxisOrientations(CoordinateSystem cs, Dimensioned dim)
cs
is null
, then an array of length
dim.getDimension()
is created and filled with
(x,y,z,t)
axis orientations.
private static GeographicCoordinateSystem normalize(GeographicCoordinateSystem cs, Projection projection)
GeographicCoordinateSystem
use standard axis
(longitude and latitude in degrees), Greenwich prime meridian and an ellipsoid
matching projection's parameters. If cs
already meets all those
conditions, then it is returned unchanged. Otherwise, a new normalized geographic
coordinate system is created and returned.
private static ProjectedCoordinateSystem normalize(ProjectedCoordinateSystem cs)
ProjectedCoordinateSystem
use standard axis
(x and y in metres) and a normalized GeographicCoordinateSystem
.
If cs
already meets all those conditions, then it is
returned unchanged. Otherwise, a new normalized projected coordinate
system is created and returned.
private static boolean hasStandardAxis(HorizontalCoordinateSystem cs, Unit unit)
true
if the specified coordinate
system use standard axis and standard units.
cs
- The coordinate system to test.private static java.lang.String getTemporaryName(CoordinateSystem source)
source
- The coordinate system to base name on, or null
if none.final java.lang.Object toOpenGIS(java.lang.Object adapters)
Object
in order
to avoid too early class loading of OpenGIS interface.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |