Spatial DataBlade
JAVA API v8.21

com.ibm.spatial.geom
Class IfxLineString

java.lang.Object
  extended by com.ibm.spatial.geom.IfxGeometry
      extended by com.ibm.spatial.geom.IfxMultiCoord
          extended by com.ibm.spatial.geom.IfxLineString
All Implemented Interfaces:
Curve, Geometry, LineString, java.lang.Cloneable

public class IfxLineString
extends IfxMultiCoord
implements LineString

IfxLineString implements the LineString interface.

See Also:
IfxGeometry, LineString

Field Summary
 
Fields inherited from class com.ibm.spatial.geom.IfxGeometry
COORD_M, COORD_XY, COORD_Z
 
Method Summary
 int dimension()
          Returns the dimension of this geometry object.
 Point endPoint()
          Returns the end point of a LineString.
 void endPoint(CoordPoint point)
          Copy the coordinates of the last point of this curve into the specified argument point.
 boolean equals(java.lang.Object anObject)
          Compares this IfxLineString to the specified object.
 java.lang.String geometryType()
          Gets the most appropriate OGC geometry interface type for this object.
 void getPointAt(CoordPoint p, int index)
          Returns the point at the specified position in this geometry.
 CoordPoint getPointAt(int index)
          Returns the point at the specified position in this geometry.
 boolean isClosed()
          Tests whether this LineString is closed, that is, its start point is equal to its end point.
 boolean isRing()
          Tests whether this LineString is a ring (is closed and simple).
 java.util.ListIterator iterator()
          Returns a list of CoordPoints iterator of the vertices in this LineString.
 java.util.ListIterator iterator(int index)
          Returns a list of CoordPoints iterator of the vertices in this LineString (in proper sequence), starting at the specified position.
 int numParts()
          Returns the number of parts of this object.
 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.
 Point pointN(int index)
          Returns the vertex at the specified position in this LineString.
 Point startPoint()
          Returns the start point of this LineString.
 void startPoint(CoordPoint point)
          Copy the coordinates of the first point of this curve into the specified argument point.
 Point value(double r)
          Returns the point located r coordinate units along the Curve from the start point.
 
Methods inherited from class com.ibm.spatial.geom.IfxMultiCoord
getLabelPoint, is3D, isEmpty, isMeasured, length, numPoints, numPoints, toCoordArray, toPointArray
 
Methods inherited from class com.ibm.spatial.geom.IfxGeometry
area, asBinary, asText, boundary, buffer, clone, contains, convexHull, crosses, difference, disjoint, distance, envelope, envelopesIntersect, extent, exterior, 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
 
Methods inherited from interface com.ibm.spatial.geom.LineString
numPoints
 
Methods inherited from interface com.ibm.spatial.geom.Curve
length
 
Methods inherited from interface com.ibm.spatial.geom.Geometry
asBinary, asText, boundary, buffer, contains, convexHull, crosses, difference, disjoint, distance, envelope, envelopesIntersect, extent, exterior, interior, intersection, intersects, is3D, isEmpty, isMeasured, isSimple, isValid, locateAlong, locateBetween, overlaps, srid, symmetricDiff, touches, union, within
 

Method Detail

pointN

public Point pointN(int index)
Returns the vertex at the specified position in this LineString.

Specified by:
pointN in interface LineString
Parameters:
index - index of the point to return
Returns:
the point at the specified position in this LineString
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= numPoints()).
See Also:
getPointAt(int)

getPointAt

public CoordPoint getPointAt(int index)
Returns the point at the specified position in this geometry. This method calls getPointAt(CoordPoint, int).

Specified by:
getPointAt in interface LineString
Parameters:
index - index of element to return
Returns:
the point at the specified position in this geometry
Throws:
java.lang.IndexOutOfBoundsException - if the index offset is out of range (offset < 0 || offset >= numPoints())
java.lang.NullPointerException - if p is null
See Also:
getPointAt(CoordPoint p, int index)

getPointAt

public void getPointAt(CoordPoint p,
                       int index)
Returns the point at the specified position in this geometry.

Specified by:
getPointAt in interface LineString
Parameters:
p - placeholder for the coordinates to be returned
index - index of the element to return
Throws:
java.lang.IndexOutOfBoundsException - if the index offset is out of range (offset < 0 || offset >= numPoints())
java.lang.NullPointerException - if p is null
See Also:
IfxMultiCoord.numPoints(), getPointAt(int index)

startPoint

public void startPoint(CoordPoint point)
Copy the coordinates of the first point of this curve into the specified argument point.

Specified by:
startPoint in interface Curve
Parameters:
point - the CoordPoint to be filled in with the coordinates of the first point of this curve. Set the argument to an empty CoordPoint if this linestring is empty.

endPoint

public void endPoint(CoordPoint point)
Copy the coordinates of the last point of this curve into the specified argument point.

Specified by:
endPoint in interface Curve
Parameters:
point - the CoordPoint to be filled in with the coordinates of the last point of this curve. Set the argument to an empty CoordPoint if this linestring is empty.
See Also:
CoordPoint

startPoint

public Point startPoint()
Returns the start point of this LineString.

Specified by:
startPoint in interface Curve
Returns:
a geometry representing the start point of this curve

endPoint

public Point endPoint()
Returns the end point of a LineString.

Specified by:
endPoint in interface Curve
Returns:
a geometry object representing the end point of this geometry

isClosed

public boolean isClosed()
Tests whether this LineString is closed, that is, its start point is equal to its end point.

Specified by:
isClosed in interface Curve
Returns:
true if this Curve is closed; otherwise false

isRing

public boolean isRing()
Tests whether this LineString is a ring (is closed and simple).

Specified by:
isRing in interface Curve
Returns:
true if this Curve is a ring; otherwise false

value

public Point value(double r)
Returns the point located r coordinate units along the Curve from the start point. If r is less than zero or greater than the length of this curve, an exception is raised. Note that value(0.0) = start_point and value(length) = end_point.

Specified by:
value in interface Curve
Parameters:
r - length of the curve between the start point and the point to be returned
Returns:
the point located r coordinate units along this object from the start point

dimension

public int dimension()

Returns the dimension of this geometry object. A geometry's dimension can be:

Specified by:
dimension in interface Geometry
Specified by:
dimension in class IfxGeometry
Returns:
The dimension of this geometry.

equals

public boolean equals(java.lang.Object anObject)
Compares this IfxLineString to the specified object. The result is true if and only if the argument is not null and is a IfxLineString 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 IfxMultiCoord
Parameters:
anObject - the object to compare this IfxLineString against.
Returns:
true if the IfxLineStrings are equal; false otherwise.

geometryType

public java.lang.String geometryType()
Gets the most appropriate OGC geometry interface type for this object.

Overrides:
geometryType in class IfxGeometry
Returns:
a string that identifies the OGC interface related to this geometry

perimeter

public double perimeter()
Returns the perimeter of this object, as measured in the spatial reference system of this object.

This implementation returns 0.

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

numParts

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

Overrides:
numParts in class IfxMultiCoord
Returns:
the number of parts

numSubParts

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

Overrides:
numSubParts in class IfxMultiCoord
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()

iterator

public java.util.ListIterator iterator()
Returns a list of CoordPoints iterator of the vertices in this LineString. This implementation returns iterator(0).

Returns:
an iterator of the vertices in this list (in proper sequence).
See Also:
iterator(int)

iterator

public java.util.ListIterator iterator(int index)
Returns a list of CoordPoints iterator of the vertices in this LineString (in proper sequence), starting at the specified position. The specified index indicates the first point that would be returned by an initial call to the next method. An initial call to the previous method would return the element with the specified index minus one.

This implementation returns a straightforward implementation of the ListIterator interface that extends the implementation of the Iterator interface returned by the iterator() method. The ListIterator implementation relies on the backing getPointAt(int) method.

Note that the list iterator returned by this implementation will throw a UnsupportedOperationException in response to its remove, set and add methods.

Parameters:
index - index of the first CoordPoint to be returned from the iterator (by a call to the getPointAt(int index) method).
Returns:
a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > numPoints()).

Spatial DataBlade
JAVA API v8.21


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