net.surveyos.sourceforge.jtswarped.utilities
Class JtsLineStringUtilities

java.lang.Object
  extended by net.surveyos.sourceforge.jtswarped.utilities.JtsLineStringUtilities

public class JtsLineStringUtilities
extends java.lang.Object

A set of utilities that operate on or work with JTS LineString objects.


Constructor Summary
JtsLineStringUtilities()
           
 
Method Summary
 java.util.Collection<com.vividsolutions.jts.geom.LineSegment> getAllSegments(com.vividsolutions.jts.geom.LineString argTarget)
          Returns a list with a LineSegment for each segment in the LineString.
 com.vividsolutions.jts.geom.Coordinate[] getFirstAndLastCoordinates(com.vividsolutions.jts.geom.LineString argLineString)
          Returns an array with the first and last Coordinates of the LineString.
 com.vividsolutions.jts.geom.Coordinate getFirstCoordinate(com.vividsolutions.jts.geom.LineString argLineString)
          Returns the first Coordinate of the LineString.
 com.vividsolutions.jts.geom.LineSegment getFirstSegment(com.vividsolutions.jts.geom.LineString argTarget)
          Returns the LineSegment representing the first segment in the LineString.
 com.vividsolutions.jts.geom.Coordinate getLastCoordinate(com.vividsolutions.jts.geom.LineString argLineString)
          Returns the last coordinate of the LineString.
 double getLengthOfLongestSegment(com.vividsolutions.jts.geom.LineString argTarget)
          Returns the length of the longest segment in the LineString.
 double getLengthOfShortestSegment(com.vividsolutions.jts.geom.LineString argTarget)
          Returns the length of the shortest segment in the LineString.
 com.vividsolutions.jts.geom.LineSegment getLongestSegment(com.vividsolutions.jts.geom.LineString argTarget)
          Returns the longest segment of the LineString passed as an argument.
 int getNumberOfSegments(com.vividsolutions.jts.geom.LineString argTarget)
          Returns the number of segments in the LineString.
static java.util.List<SurveyorsDirection> getSegmentDirections(com.vividsolutions.jts.geom.LineString argTarget)
          Returns a list with the SureyorsDirection for each segment in the LineString.
 java.util.List<java.lang.Double> getSegmentLengths(com.vividsolutions.jts.geom.LineString argTarget)
          Returns a list containing the lengths of each segment in the LineString.
 com.vividsolutions.jts.geom.LineSegment getShortestSegment(com.vividsolutions.jts.geom.LineString argTarget)
          Returns the shortest segment of the LineString passed as an argument.
 boolean testLineStringsForEqaulity(com.vividsolutions.jts.geom.LineString first, com.vividsolutions.jts.geom.LineString second, double argTolerance)
          Tests the two (2) LineString objects provided as arguments for equality.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JtsLineStringUtilities

public JtsLineStringUtilities()
Method Detail

getFirstAndLastCoordinates

public com.vividsolutions.jts.geom.Coordinate[] getFirstAndLastCoordinates(com.vividsolutions.jts.geom.LineString argLineString)
Returns an array with the first and last Coordinates of the LineString.


getFirstCoordinate

public com.vividsolutions.jts.geom.Coordinate getFirstCoordinate(com.vividsolutions.jts.geom.LineString argLineString)
Returns the first Coordinate of the LineString.


getLastCoordinate

public com.vividsolutions.jts.geom.Coordinate getLastCoordinate(com.vividsolutions.jts.geom.LineString argLineString)
Returns the last coordinate of the LineString.


getNumberOfSegments

public int getNumberOfSegments(com.vividsolutions.jts.geom.LineString argTarget)
Returns the number of segments in the LineString.


getLengthOfShortestSegment

public double getLengthOfShortestSegment(com.vividsolutions.jts.geom.LineString argTarget)
Returns the length of the shortest segment in the LineString.


getLengthOfLongestSegment

public double getLengthOfLongestSegment(com.vividsolutions.jts.geom.LineString argTarget)
Returns the length of the longest segment in the LineString.


getShortestSegment

public com.vividsolutions.jts.geom.LineSegment getShortestSegment(com.vividsolutions.jts.geom.LineString argTarget)
Returns the shortest segment of the LineString passed as an argument. If there is more than one segment with the same length, the first one encountered will be returned. You can use the hasSegmentsTheSameLength method in this class to determine if a LineString has segments with the same length.


getLongestSegment

public com.vividsolutions.jts.geom.LineSegment getLongestSegment(com.vividsolutions.jts.geom.LineString argTarget)
Returns the longest segment of the LineString passed as an argument. If there is more than one segment with the same length, the first one encountered will be returned. You can use the hasSegmentsTheSameLength method in this class to determine if a LineString has segments with the same length.


getSegmentLengths

public java.util.List<java.lang.Double> getSegmentLengths(com.vividsolutions.jts.geom.LineString argTarget)
Returns a list containing the lengths of each segment in the LineString.


getSegmentDirections

public static java.util.List<SurveyorsDirection> getSegmentDirections(com.vividsolutions.jts.geom.LineString argTarget)
Returns a list with the SureyorsDirection for each segment in the LineString.


getAllSegments

public java.util.Collection<com.vividsolutions.jts.geom.LineSegment> getAllSegments(com.vividsolutions.jts.geom.LineString argTarget)
Returns a list with a LineSegment for each segment in the LineString.


getFirstSegment

public com.vividsolutions.jts.geom.LineSegment getFirstSegment(com.vividsolutions.jts.geom.LineString argTarget)
Returns the LineSegment representing the first segment in the LineString.


testLineStringsForEqaulity

public boolean testLineStringsForEqaulity(com.vividsolutions.jts.geom.LineString first,
                                          com.vividsolutions.jts.geom.LineString second,
                                          double argTolerance)
Tests the two (2) LineString objects provided as arguments for equality. Returns true if both Linestrings have the same number of points, the same length, and coordinates that match each other within the tolerance passed as a double argument. (The test for equality in the coordinates is performed by seeing if the horizontal distance between a pair of corresponding coordinates is less than the tolerance.)