org.geotools.geometry.iso.coordinate
Class LineStringImpl

java.lang.Object
  extended by org.geotools.geometry.iso.coordinate.CurveSegmentImpl
      extended by org.geotools.geometry.iso.coordinate.LineStringImpl
All Implemented Interfaces:
java.io.Serializable, org.opengis.geometry.coordinate.GenericCurve, org.opengis.geometry.coordinate.LineString, org.opengis.geometry.primitive.CurveSegment
Direct Known Subclasses:
LineSegmentImpl

public class LineStringImpl
extends CurveSegmentImpl
implements org.opengis.geometry.coordinate.LineString

A LineString consists of sequence of line segments, each having a parameterization like the one for LineSegment. The class essentially combines a Sequence into a single object, with the obvious savings of storage space.

Author:
Jackson Roehrig & Sanjay Jena
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.geotools.geometry.iso.coordinate.CurveSegmentImpl
endParam, interpolation, startParam
 
Constructor Summary
LineStringImpl(LineStringImpl lineString)
          Constructor by another LineString The constructor for LineString takes a sequence of points and constructs a LineString with those points as controlPoints.
LineStringImpl(java.util.List<org.opengis.geometry.coordinate.Position> positions)
           
LineStringImpl(PointArrayImpl pointArray, double startPar)
          Constructor by a PointArray and a StartParam
 
Method Summary
 java.util.List<org.opengis.geometry.coordinate.LineSegment> asLineSegments()
           
 LineStringImpl asLineString(double maxSpacing, double maxOffset)
           
 boolean equals(java.lang.Object obj)
           
 org.opengis.geometry.DirectPosition forConstructiveParam(double cp)
           
 org.opengis.geometry.DirectPosition forParam(double distance)
           
 org.opengis.geometry.coordinate.PointArray getControlPoints()
           
 org.opengis.geometry.DirectPosition getEndPoint()
           
 org.opengis.geometry.coordinate.Position getEndPosition()
           
 EnvelopeImpl getEnvelope()
          Added to Class requirements of CurveSegments Returns the envelope of the CurveSegment
 int getNumDerivativesAtEnd()
           
 int getNumDerivativesAtStart()
           
 int getNumDerivativesInterior()
           
 org.opengis.geometry.coordinate.ParamForPoint getParamForPoint(org.opengis.geometry.DirectPosition p)
           
 org.opengis.geometry.coordinate.PointArray getSamplePoints()
           
 org.opengis.geometry.DirectPosition getStartPoint()
          The reverse of a CurveSegment simply reverses the orientation of the parameterizations of the segment.
 org.opengis.geometry.coordinate.Position getStartPosition()
           
 double[] getTangent(double distance)
           
 int hashCode()
           
 LineStringImpl merge(LineStringImpl other)
          Merges this LineString with another LineString, forming a new LineString The input LineStrings will not be modified by this operation.
 CurveSegmentImpl reverse()
           
 void split(double maxSpacing)
           
 java.lang.String toString()
           
 
Methods inherited from class org.geotools.geometry.iso.coordinate.CurveSegmentImpl
getBoundary, getCurve, getEndConstructiveParam, getEndParam, getInterpolation, getStartConstructiveParam, getStartParam, length, length, length, setCurve, setEndParam, setInterpolation, setStartParam
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.geometry.primitive.CurveSegment
getBoundary, getCurve, getInterpolation
 
Methods inherited from interface org.opengis.geometry.coordinate.GenericCurve
getEndConstructiveParam, getEndParam, getStartConstructiveParam, getStartParam, length, length
 

Constructor Detail

LineStringImpl

public LineStringImpl(java.util.List<org.opengis.geometry.coordinate.Position> positions)

LineStringImpl

public LineStringImpl(LineStringImpl lineString)
Constructor by another LineString The constructor for LineString takes a sequence of points and constructs a LineString with those points as controlPoints. The constructor of a LineString takes two or more positions and creates the appropriate line string joining them. LineString::LineString(points[2..n]:Position):LineString

Parameters:
lineString -

LineStringImpl

public LineStringImpl(PointArrayImpl pointArray,
                      double startPar)
Constructor by a PointArray and a StartParam

Parameters:
pointArray -
startPar -
Method Detail

merge

public LineStringImpl merge(LineStringImpl other)
Merges this LineString with another LineString, forming a new LineString The input LineStrings will not be modified by this operation. The used Lists of the pointArray will be cloned. The Positions which represents the control points will not be cloned.

Parameters:
other - LineString

getControlPoints

public org.opengis.geometry.coordinate.PointArray getControlPoints()
Specified by:
getControlPoints in interface org.opengis.geometry.coordinate.LineString

asLineSegments

public java.util.List<org.opengis.geometry.coordinate.LineSegment> asLineSegments()
Specified by:
asLineSegments in interface org.opengis.geometry.coordinate.LineString

getStartPoint

public org.opengis.geometry.DirectPosition getStartPoint()
Description copied from class: CurveSegmentImpl
The reverse of a CurveSegment simply reverses the orientation of the parameterizations of the segment. CurveSegment::reverse() : CurveSegment

Specified by:
getStartPoint in interface org.opengis.geometry.coordinate.GenericCurve
Specified by:
getStartPoint in class CurveSegmentImpl
Returns:
DirectPositionImpl

getEndPoint

public org.opengis.geometry.DirectPosition getEndPoint()
Specified by:
getEndPoint in interface org.opengis.geometry.coordinate.GenericCurve
Specified by:
getEndPoint in class CurveSegmentImpl

getStartPosition

public org.opengis.geometry.coordinate.Position getStartPosition()
Specified by:
getStartPosition in class CurveSegmentImpl
Returns:
start position

getEndPosition

public org.opengis.geometry.coordinate.Position getEndPosition()
Specified by:
getEndPosition in class CurveSegmentImpl
Returns:
end position

split

public void split(double maxSpacing)
Specified by:
split in class CurveSegmentImpl

getNumDerivativesAtStart

public int getNumDerivativesAtStart()
Specified by:
getNumDerivativesAtStart in interface org.opengis.geometry.primitive.CurveSegment

getNumDerivativesInterior

public int getNumDerivativesInterior()
Specified by:
getNumDerivativesInterior in interface org.opengis.geometry.primitive.CurveSegment

getNumDerivativesAtEnd

public int getNumDerivativesAtEnd()
Specified by:
getNumDerivativesAtEnd in interface org.opengis.geometry.primitive.CurveSegment

getSamplePoints

public org.opengis.geometry.coordinate.PointArray getSamplePoints()
Specified by:
getSamplePoints in interface org.opengis.geometry.primitive.CurveSegment

reverse

public CurveSegmentImpl reverse()
Specified by:
reverse in interface org.opengis.geometry.primitive.CurveSegment

getTangent

public double[] getTangent(double distance)
Specified by:
getTangent in interface org.opengis.geometry.coordinate.GenericCurve

forConstructiveParam

public org.opengis.geometry.DirectPosition forConstructiveParam(double cp)
Specified by:
forConstructiveParam in interface org.opengis.geometry.coordinate.GenericCurve

getEnvelope

public EnvelopeImpl getEnvelope()
Description copied from class: CurveSegmentImpl
Added to Class requirements of CurveSegments Returns the envelope of the CurveSegment

Specified by:
getEnvelope in class CurveSegmentImpl
Returns:
Envelope of the CurveSegment

forParam

public org.opengis.geometry.DirectPosition forParam(double distance)
Specified by:
forParam in interface org.opengis.geometry.coordinate.GenericCurve

getParamForPoint

public org.opengis.geometry.coordinate.ParamForPoint getParamForPoint(org.opengis.geometry.DirectPosition p)
Specified by:
getParamForPoint in interface org.opengis.geometry.coordinate.GenericCurve

asLineString

public LineStringImpl asLineString(double maxSpacing,
                                   double maxOffset)
Specified by:
asLineString in interface org.opengis.geometry.coordinate.GenericCurve

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.