com.partnersoft.geometry.projection
Class CoordinateTransformation
java.lang.Object
com.partnersoft.geometry.projection.CoordinateTransformation
- All Implemented Interfaces:
- Coggable
public class CoordinateTransformation
- extends java.lang.Object
- implements Coggable
Handles transformation of coordinates from one system to
another. Both reverse and forward projection are provided, along
with input and output scaling and offsets. This allows a variety of
transformations, including but not limited to:
- feet to meters
- meters to feet
- state plane feet to latlong
- latlong to state plane feet
- utm to state plane via latlong
For truly weird transformations,
write a special implementation of Projection.
The order of application is:
- addition of inputOffset
- multiplication by inputScale
- reverse projection using reverseProjection
- forward projection using projection
- multiplication by outputScale
- addition of outputOffset
Notice that this means the offsets are always in the correct
units of either the input coordinate system or output coordinate
system. Also note that, in general, projections are done in meters,
which must be converted from feet (or inches, or furlongs, or whatever).
If either projection is empty or blank, nothing is done for those
stages. Zero inputScale or outputScale is interpreted as 1 (no
change) rather than actual zero (which would simply zero out any
input). The algorithm is optimized to do nothing for the default
case of no scaling, projection, or offset, and you can check the
isIdentity() property to see if it is such a case and avoid passing
points to it at all.
- Author:
- Paul Reavis
Copyright 2005 Partner Software, Inc.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CoordinateTransformation
public CoordinateTransformation()
transform
public Point transform(double x,
double y)
transform
public void transform(Point point)
- Modifies the coordinates of the input Point.
transform
public void transform(DoubleBuffer coords)
- Modifies the given DoubleBuffer, treating it as a list of x, y
pairs.
isIdentity
public boolean isIdentity()
getState
public Cog getState()
- Specified by:
getState in interface Coggable
setState
public void setState(Cog state)
- Specified by:
setState in interface Coggable
setInputScaleX
public void setInputScaleX(double d)
getInputScaleX
public double getInputScaleX()
setInputScaleY
public void setInputScaleY(double d)
getInputScaleY
public double getInputScaleY()
setInputOffsetX
public void setInputOffsetX(double d)
getInputOffsetX
public double getInputOffsetX()
setInputOffsetY
public void setInputOffsetY(double d)
getInputOffsetY
public double getInputOffsetY()
getProjectionName
public java.lang.String getProjectionName()
setOutputScaleX
public void setOutputScaleX(double d)
getOutputScaleX
public double getOutputScaleX()
setOutputScaleY
public void setOutputScaleY(double d)
getOutputScaleY
public double getOutputScaleY()
setOutputOffsetX
public void setOutputOffsetX(double d)
getOutputOffsetX
public double getOutputOffsetX()
setOutputOffsetY
public void setOutputOffsetY(double d)
getOutputOffsetY
public double getOutputOffsetY()
getReverseProjectionName
public java.lang.String getReverseProjectionName()