Spatial DataBlade
JAVA API v8.21

com.ibm.spatial.geom
Class IfxMultiCoord

java.lang.Object
  extended by com.ibm.spatial.geom.IfxGeometry
      extended by com.ibm.spatial.geom.IfxMultiCoord
All Implemented Interfaces:
Geometry, java.lang.Cloneable
Direct Known Subclasses:
IfxGeometryCollection, IfxLineString, IfxSurface

public abstract class IfxMultiCoord
extends IfxGeometry

IfxMultiCoord is a non-instantiable class holding all the common attributes and methods of geometries with more than one vertex.

See Also:
IfxGeometry

Field Summary
 
Fields inherited from class com.ibm.spatial.geom.IfxGeometry
COORD_M, COORD_XY, COORD_Z
 
Method Summary
 boolean equals(java.lang.Object anObject)
          Compares this object to the specified object.
 void getLabelPoint(CoordPoint point)
          Calculates a reasonable point location that can be used for labeling.
 boolean is3D()
          Tests whether or not this geometry object has three-dimensional coordinates.
 boolean isEmpty()
          Tests whether this geometry object is empty.
 boolean isMeasured()
          Tests whether or not this geometry object has measures.
 double length()
          Returns the length of this object.
 int numParts()
          Returns the number of parts of this object.
 int numPoints()
          Returns the number of points in this geometry.
 int numPoints(int part, int subPart)
          Returns the number of points in the specified part and subpart.
 int numSubParts(int part)
          Returns the number of subparts in the specified part.
 double perimeter()
          Returns the perimeter of this object, as measured in the spatial reference system of this object.
 int toCoordArray(double[] buf, int destOffset, int coordType, int srcOffset, int part, int subPart)
          Gets the coordinates of up to count points from the specified part and subpart of this object, starting with the position specified by index.
 int toPointArray(CoordPoint[] pointArray, int destOffset, int srcOffset, int part, int subPart)
          Copies up to count points from the specified part and subpart of this object, starting with the point at the position specified by index (relative to the current subpart beginning position), into pointArray.
 
Methods inherited from class com.ibm.spatial.geom.IfxGeometry
area, asBinary, asText, boundary, buffer, clone, contains, convexHull, crosses, difference, dimension, disjoint, distance, envelope, envelopesIntersect, extent, exterior, geometryType, getCoordinateDimension, getDimensionality, getLabelPoint, getOGCType, interior, intersection, intersects, isSimple, isValid, locateAlong, locateBetween, overlaps, srid, symmetricDiff, toString, touches, union, within
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isEmpty

public boolean isEmpty()
Tests whether this geometry object is empty.

Specified by:
isEmpty in interface Geometry
Overrides:
isEmpty in class IfxGeometry
Returns:
true if this geometry object is empty; otherwise, returns false

is3D

public boolean is3D()
Tests whether or not this geometry object has three-dimensional coordinates.

Specified by:
is3D in interface Geometry
Overrides:
is3D in class IfxGeometry
Returns:
true if this object has three-dimensional coordinates; otherwise, returns false

isMeasured

public boolean isMeasured()
Tests whether or not this geometry object has measures.

Specified by:
isMeasured in interface Geometry
Overrides:
isMeasured in class IfxGeometry
Returns:
true if this object has measures; otherwise, returns false

numPoints

public int numPoints()
Returns the number of points in this geometry.

Specified by:
numPoints in interface Geometry
Specified by:
numPoints in class IfxGeometry
Returns:
the number of points in this geometry

getLabelPoint

public void getLabelPoint(CoordPoint point)
                   throws SpatialException
Calculates a reasonable point location that can be used for labeling.

This implementation returns the center of this object's envelope. In order to modify the behavior of this method, subclasses must override calcLabelPoint.

Overrides:
getLabelPoint in class IfxGeometry
Parameters:
point - a CoordPoint object to be filled with the coordinates of the label point. Returns an empty point if this geometry is empty.
Throws:
SpatialException - if an error occurs during the calculation of the label point coordinates

length

public double length()
Returns the length of this object.

Overrides:
length in class IfxGeometry
Returns:
Returns the length of this object in its associated spatial reference.

perimeter

public double perimeter()
Returns the perimeter of this object, as measured in the spatial reference system of this object. This implementation calls the method length.

Overrides:
perimeter in class IfxGeometry
Returns:
the perimeter of this object
See Also:
length()

equals

public boolean equals(java.lang.Object anObject)
Compares this object to the specified object. The result is true if and only if the argument is not null and is an object that represents the same sequence of coordinates as this object.

The coordinates are compared within the precision specified by this object's SRS.

Specified by:
equals in interface Geometry
Overrides:
equals in class IfxGeometry
Parameters:
anObject - the object to compare this object against.
Returns:
true if the objects are equal; false otherwise.

numParts

public int numParts()
Returns the number of parts of this object.

Specified by:
numParts in class IfxGeometry
Returns:
the number of parts

numSubParts

public int numSubParts(int part)
Returns the number of subparts in the specified part.

Specified by:
numSubParts in class IfxGeometry
Parameters:
part - part index
Returns:
the number of subparts in the specified part
Throws:
java.lang.IndexOutOfBoundsException - for non-empty geometries, if the given part index is out of range (part < 0 || part >= numParts()).
See Also:
numParts()

numPoints

public int numPoints(int part,
                     int subPart)
Returns the number of points in the specified part and subpart.

Specified by:
numPoints in class IfxGeometry
Parameters:
part - part index
subPart - subpart index
Returns:
the number of points in the specified part and subpart
Throws:
java.lang.IndexOutOfBoundsException - for non-empty geometries, if the given part and subpart indexes are out of range (part < 0 || part >= numParts()) || (subPart < 0 || subPart >= numSubParts(part)).
See Also:
numParts(), numSubParts(int)

toCoordArray

public int toCoordArray(double[] buf,
                        int destOffset,
                        int coordType,
                        int srcOffset,
                        int part,
                        int subPart)

Gets the coordinates of up to count points from the specified part and subpart of this object, starting with the position specified by index. The value of index is relative to the beginning of the current subpart.

The order in which coordinates are returned is specified as follows: - COORD_XY - the return sequence is: X,Y,X,Y,... - COORD_XY | COORD_Z - the return sequence is: X,Y,Z,X,Y,Z,... - COORD_XY | COORD_Z | COORD_M - the return sequence is: X,Y,Z,M,X,Y,Z,M,... - COORD_Z | COORD_M - the return sequence is: Z,M,Z,M,... etc.

The number of points read is limited by the available space in the destination buffer, and the number of remaining points in the current part/subpart.

In case of geometries with more than one point, if coordType only equals one of the flag values, then the coordinate values are copied into the buffer in the manner performed by System.arraycopy.

Specified by:
toCoordArray in class IfxGeometry
Parameters:
buf - the array of double where point coordinates are returned. If buffer is null, an error is reported
destOffset - the starting position in the destination buffer where coordinates are written
coordType - specifies which coordinates are returned. It may be any combination of the flag values COORD_XY, COORD_Z, and COORD_M.
srcOffset - the position of the first point whose coordinates are copied, relative to the beginning of the specified part and subpart
part - the current geometry part (see numParts)
subPart - the current subpart (see numParts)
Returns:
the number of points actually read from this object
Throws:
java.lang.IndexOutOfBoundsException - if case of non-empty geometries, if an attempt is made to write past the destination array boundaries or the given part and subpart indexes are out of range (part < 0 || part >= numParts()) || (subPart < 0 || subPart >= numSubParts(part)).
See Also:
IfxGeometry.COORD_XY, IfxGeometry.COORD_Z, IfxGeometry.COORD_M

toPointArray

public int toPointArray(CoordPoint[] pointArray,
                        int destOffset,
                        int srcOffset,
                        int part,
                        int subPart)

Copies up to count points from the specified part and subpart of this object, starting with the point at the position specified by index (relative to the current subpart beginning position), into pointArray.

The number of points read count is equal to the smaller of pointArray.length - destOffset and numPoints(part, subpart)-srcOffset. If count is positive, then points starting with position srcOffset through srcOffset+count-1 are copied into buf. The value count is returned.

If pointArray is reused for several calls, this method may be used to save allocation costs.

Specified by:
toPointArray in class IfxGeometry
Parameters:
pointArray - the array of CoordPoints where point coordinates are copied into
destOffset - start position in the destination array pointArray
srcOffset - position of the first point whose coordinates are returned, relative to the beginning of the specified part and subpart
part - current geometry part (see numParts)
subPart - current subpart (see numParts)
Returns:
the number of points actually read from this object
Throws:
java.lang.IndexOutOfBoundsException - if case of non-empty geometries, if an attempt is made to write past the destination array boundaries or the given part and subpart indexes are out of range (part < 0 || part >= numParts()) || (subPart < 0 || subPart >= numSubParts(part)).

Spatial DataBlade
JAVA API v8.21


Licensed Materials - Property of IBM
Copyright IBM Corp. 2002, 2012 All Rights Reserved.