Class AxisPlaneCoordinateSequence
- java.lang.Object
-
- org.meteoinfo.jts.operation.distance3d.AxisPlaneCoordinateSequence
-
- All Implemented Interfaces:
java.lang.Cloneable,CoordinateSequence
public class AxisPlaneCoordinateSequence extends java.lang.Object implements CoordinateSequence
A CoordinateSequence wrapper which projects 3D coordinates into one of the three Cartesian axis planes, using the standard orthonormal projection (i.e. simply selecting the appropriate ordinates into the XY ordinates). The projected data is represented as 2D coordinates.
-
-
Field Summary
-
Fields inherited from interface org.meteoinfo.jts.geom.CoordinateSequence
M, X, Y, Z
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a deep copy of this collection.EnvelopeexpandEnvelope(Envelope env)Expands the givenEnvelopeto include the coordinates in the sequence.CoordinategetCoordinate(int i)Returns (possibly a copy of) the i'th coordinate in this sequence.voidgetCoordinate(int index, Coordinate coord)Copies the i'th coordinate in the sequence to the suppliedCoordinate.CoordinategetCoordinateCopy(int i)Returns a copy of the i'th coordinate in this sequence.intgetDimension()Returns the dimension (number of ordinates in each coordinate) for this sequence.doublegetOrdinate(int index, int ordinateIndex)Returns the ordinate of a coordinate in this sequence.doublegetX(int index)Returns ordinate X (0) of the specified coordinate.doublegetY(int index)Returns ordinate Y (1) of the specified coordinate.doublegetZ(int index)static CoordinateSequenceprojectToXY(CoordinateSequence seq)Creates a wrapper projecting to the XY plane.static CoordinateSequenceprojectToXZ(CoordinateSequence seq)Creates a wrapper projecting to the XZ plane.static CoordinateSequenceprojectToYZ(CoordinateSequence seq)Creates a wrapper projecting to the YZ plane.voidsetOrdinate(int index, int ordinateIndex, double value)Sets the value for a given ordinate of a coordinate in this sequence.intsize()Returns the number of coordinates in this sequence.Coordinate[]toCoordinateArray()Returns (possibly copies of) the Coordinates in this collection.
-
-
-
Method Detail
-
projectToXY
public static CoordinateSequence projectToXY(CoordinateSequence seq)
Creates a wrapper projecting to the XY plane.- Parameters:
seq- the sequence to be projected- Returns:
- a sequence which projects coordinates
-
projectToXZ
public static CoordinateSequence projectToXZ(CoordinateSequence seq)
Creates a wrapper projecting to the XZ plane.- Parameters:
seq- the sequence to be projected- Returns:
- a sequence which projects coordinates
-
projectToYZ
public static CoordinateSequence projectToYZ(CoordinateSequence seq)
Creates a wrapper projecting to the YZ plane.- Parameters:
seq- the sequence to be projected- Returns:
- a sequence which projects coordinates
-
getDimension
public int getDimension()
Description copied from interface:CoordinateSequenceReturns the dimension (number of ordinates in each coordinate) for this sequence.- Specified by:
getDimensionin interfaceCoordinateSequence- Returns:
- the dimension of the sequence.
-
getCoordinate
public Coordinate getCoordinate(int i)
Description copied from interface:CoordinateSequenceReturns (possibly a copy of) the i'th coordinate in this sequence. Whether or not the Coordinate returned is the actual underlying Coordinate or merely a copy depends on the implementation.Note that in the future the semantics of this method may change to guarantee that the Coordinate returned is always a copy. Callers should not to assume that they can modify a CoordinateSequence by modifying the object returned by this method.
- Specified by:
getCoordinatein interfaceCoordinateSequence- Parameters:
i- the index of the coordinate to retrieve- Returns:
- the i'th coordinate in the sequence
-
getCoordinateCopy
public Coordinate getCoordinateCopy(int i)
Description copied from interface:CoordinateSequenceReturns a copy of the i'th coordinate in this sequence. This method optimizes the situation where the caller is going to make a copy anyway - if the implementation has already created a new Coordinate object, no further copy is needed.- Specified by:
getCoordinateCopyin interfaceCoordinateSequence- Parameters:
i- the index of the coordinate to retrieve- Returns:
- a copy of the i'th coordinate in the sequence
-
getCoordinate
public void getCoordinate(int index, Coordinate coord)Description copied from interface:CoordinateSequenceCopies the i'th coordinate in the sequence to the suppliedCoordinate. Only the first two dimensions are copied.- Specified by:
getCoordinatein interfaceCoordinateSequence- Parameters:
index- the index of the coordinate to copycoord- aCoordinateto receive the value
-
getX
public double getX(int index)
Description copied from interface:CoordinateSequenceReturns ordinate X (0) of the specified coordinate.- Specified by:
getXin interfaceCoordinateSequence- Returns:
- the value of the X ordinate in the index'th coordinate
-
getY
public double getY(int index)
Description copied from interface:CoordinateSequenceReturns ordinate Y (1) of the specified coordinate.- Specified by:
getYin interfaceCoordinateSequence- Returns:
- the value of the Y ordinate in the index'th coordinate
-
getZ
public double getZ(int index)
-
getOrdinate
public double getOrdinate(int index, int ordinateIndex)Description copied from interface:CoordinateSequenceReturns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinates indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values).- Specified by:
getOrdinatein interfaceCoordinateSequence- Parameters:
index- the coordinate index in the sequenceordinateIndex- the ordinate index in the coordinate (in range [0, dimension-1])
-
size
public int size()
Description copied from interface:CoordinateSequenceReturns the number of coordinates in this sequence.- Specified by:
sizein interfaceCoordinateSequence- Returns:
- the size of the sequence
-
setOrdinate
public void setOrdinate(int index, int ordinateIndex, double value)Description copied from interface:CoordinateSequenceSets the value for a given ordinate of a coordinate in this sequence.- Specified by:
setOrdinatein interfaceCoordinateSequence- Parameters:
index- the coordinate index in the sequenceordinateIndex- the ordinate index in the coordinate (in range [0, dimension-1])value- the new ordinate value
-
toCoordinateArray
public Coordinate[] toCoordinateArray()
Description copied from interface:CoordinateSequenceReturns (possibly copies of) the Coordinates in this collection. Whether or not the Coordinates returned are the actual underlying Coordinates or merely copies depends on the implementation. Note that if this implementation does not store its data as an array of Coordinates, this method will incur a performance penalty because the array needs to be built from scratch.- Specified by:
toCoordinateArrayin interfaceCoordinateSequence- Returns:
- a array of coordinates containing the point values in this sequence
-
expandEnvelope
public Envelope expandEnvelope(Envelope env)
Description copied from interface:CoordinateSequenceExpands the givenEnvelopeto include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values.- Specified by:
expandEnvelopein interfaceCoordinateSequence- Parameters:
env- the envelope to expand- Returns:
- a ref to the expanded envelope
-
clone
public java.lang.Object clone()
Description copied from interface:CoordinateSequenceReturns a deep copy of this collection. Called by Geometry#clone.- Specified by:
clonein interfaceCoordinateSequence- Overrides:
clonein classjava.lang.Object- Returns:
- a copy of the coordinate sequence containing copies of all points
-
-