Class CoordSysTranslator
- java.lang.Object
-
- com.supermap.data.CoordSysTranslator
-
public final class CoordSysTranslator extends java.lang.Object
Projection Transformation class.
It is mainly used to transform in different projected coordinates and projected coordinate systems.
This projection transformation class applies to three for projection transformation, such as Geographic Longitude/Latitude to projected coordinates, projected coordinates to Geographic Longitude/Latitude, transformation between two projected coordinate systems. The two former transformation use the
forward()
method and theinverse()
method and theconvert()
method of this class to transform.Note:The current version can not support projection transformation for the grid dataset, namely, when you transform the projection in a datasource, the vector dataset will be transformed. A geographic coordinate system uses a three-dimensional spherical surface to define locations on the earth. A geographic coordinate system includes an angular unit of measure, a prime meridian, and a datum (based on a spheroid). Projected coordinate system is actually the planar coordinate system. Whether you treat the earth as a sphere or a spheroid, you must transform its three-dimensional surface to create a flat map sheet. This mathematical transformation is commonly referred to as a map projection. Consequently, this CoordSysTranslator class can provide the methods to transform in different projected coordinates and projected coordinate systems.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static boolean
convert(Geometry geometry, PrjCoordSys sourcePrjCoordSys, PrjCoordSys targetPrjCoordSys, CoordSysTransParameter coordSysTransParameter, CoordSysTransMethod coordSysTransMethod)
Transforms projection of the geometry with the source and target projected coordinate system.static boolean
convert(Point2Ds points, PrjCoordSys sourcePrjCoordSys, PrjCoordSys targetPrjCoordSys, CoordSysTransParameter coordSysTransParameter, CoordSysTransMethod coordSysTransMethod)
Transforms projection of the Point2Ds with the source and target projected coordinate system.static boolean
convert(Point3Ds points, PrjCoordSys srcPrjCoordSys, PrjCoordSys desPrjCoordSys, CoordSysTransParameter coordSysTransParameter, CoordSysTransMethod coordSysTransMethod)
Transforms projection of the Point3D set with the source and target projected coordinate system.static boolean
forward(Point2Ds points, PrjCoordSys prjCoordSys)
This method is used to transform geographic coordinates of the specifiedPoint2Ds
into projected coordinates with the specified parameters in the same geographic coordinate system.static boolean
inverse(Point2Ds points, PrjCoordSys prjCoordSys)
This method is used to transform projected (planar) coordinates of the specified point2Ds into geographic coordinates with the specified parameters in the same projected coordinate system.
-
-
-
Method Detail
-
forward
public static boolean forward(Point2Ds points, PrjCoordSys prjCoordSys)
This method is used to transform geographic coordinates of the specifiedPoint2Ds
into projected coordinates with the specified parameters in the same geographic coordinate system.- Parameters:
points
- thePoint2Ds
object specified to convert.prjCoordSys
- the projected coordinates system.- Returns:
- if the coordinates are transformed successfully, returns true; Otherwise, returns false.
-
inverse
public static boolean inverse(Point2Ds points, PrjCoordSys prjCoordSys)
This method is used to transform projected (planar) coordinates of the specified point2Ds into geographic coordinates with the specified parameters in the same projected coordinate system.- Parameters:
points
- the transformedPoint2Ds
objectprjCoordSys
- the specified projected coordinate system.- Returns:
- If the coordinates are transformed successfully, returns true; Otherwise, returns false.
-
convert
public static boolean convert(Point2Ds points, PrjCoordSys sourcePrjCoordSys, PrjCoordSys targetPrjCoordSys, CoordSysTransParameter coordSysTransParameter, CoordSysTransMethod coordSysTransMethod)
Transforms projection of the Point2Ds with the source and target projected coordinate system. This method will change the source Point2Ds.- Parameters:
points
- the Point2Ds to be transformed.sourcePrjCoordSys
- Source projection coordinate systemtargetPrjCoordSys
- Target projection coordinate systemcoordSysTransParameter
- The parameters of projection transformation. It contains three translations, three rotations in X, Y and Z axes respectively and a scale factor. Please refer to theCoordSysTransParameter
class.coordSysTransMethod
- Please refers toCoordSysTransMethod
for the methods used by projection transformation.- Returns:
- if the coordinates are transformed successfully, returns true; Otherwise, returns false.
-
convert
public static boolean convert(Point3Ds points, PrjCoordSys srcPrjCoordSys, PrjCoordSys desPrjCoordSys, CoordSysTransParameter coordSysTransParameter, CoordSysTransMethod coordSysTransMethod)
Transforms projection of the Point3D set with the source and target projected coordinate system. This method will change the source Point3D set.geometry object- Parameters:
points
- the Point3D set to be transformsrcPrjCoordSys
- Source projection coordinate systemdesPrjCoordSys
- Target projection coordinate systemcoordSysTransParameter
- The parameters of projection transformation. It contains three translations, three rotations in X, Y and Z axes respectively and a scale factor. Please refer to theCoordSysTransParameter
class.coordSysTransMethod
- Please refers toCoordSysTransMethod
for the methods used by projection transformation.- Returns:
- if the coordinates are transformed successfully, returns true; Otherwise, returns false.
-
convert
public static boolean convert(Geometry geometry, PrjCoordSys sourcePrjCoordSys, PrjCoordSys targetPrjCoordSys, CoordSysTransParameter coordSysTransParameter, CoordSysTransMethod coordSysTransMethod)
Transforms projection of the geometry with the source and target projected coordinate system. This method will change the source geometry.- Parameters:
geometry
- The transformed Geometry object.sourcePrjCoordSys
- Source projection coordinate systemtargetPrjCoordSys
- Target projection coordinate systemcoordSysTransParameter
- The parameters of projection transformation. It contains three translations, three rotations in X, Y and Z axes respectively and a scale factor. Please refer to theCoordSysTransParameter
class.coordSysTransMethod
- Please refers toCoordSysTransMethod
for the methods used by projection transformation.- Returns:
- if the coordinates are transformed successfully, returns true; Otherwise, returns false.
-
-