gistoolkit.features
Class MultiPoint

java.lang.Object
  extended bygistoolkit.features.Shape
      extended bygistoolkit.features.MultiPoint
Direct Known Subclasses:
MultiPointM

public class MultiPoint
extends Shape

Represents a collection of points.


Field Summary
 
Fields inherited from class gistoolkit.features.Shape
EQUAL_LIMIT, LINEARRING, LINESTRING, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON, myEnvelope, NULLSHAPE, POINT, POLYGON, RASTER
 
Constructor Summary
MultiPoint()
          Point constructor comment.
MultiPoint(double[] inXs, double[] inYs)
          Create a new multi point which contains a single point.
MultiPoint(double inX, double inY)
          Create a new multi point which contains a single point.
MultiPoint(Point[] inPoints)
          Create a new multi point which contains a single point.
 
Method Summary
 int add(double inX, double inY)
          Add a point to the MultiPoint returns the index of the newly added point, or -1 if it failed to add the point.
 boolean add(int inIndex, double inX, double inY)
          Adds a point to the MultiPoint at the given point index.
 void calculateEnvelope()
          Recalculates the envelope for the shape.
 java.lang.Object clone()
          Creates a copy of the MultiPoint
 int getClosestIndex(double inX, double inY)
          Return the point in the LineString that is the closest to this point.
 Point getClosestPoint(double inX, double inY)
          Return the point in the MultiPoint that is the closest to this point.
 double getDistanceToPoint(double inX, double inY)
          Get the distance from this shape to the given point
 Envelope getEnvelope()
          Retrieve the envelope for this shape.
 int getNumPoints()
          Return the number of points in this shape.
 Point getPoint(int inIndex)
          Get the point at the given index.
 Point[] getPoints()
          Returns the list of points from this multi point.
 java.lang.String getShapeType()
          Return the type of shape this is
 java.lang.String getWKT()
          Returns the OGIS Well Know Text Representation of this shape
 double[] getXCoordinates()
          Return the array of X Coordinates.
 double[] getYCoordinates()
          Return the array of Y Coordinates.
 boolean intersects(Shape inShape)
          Determines if the two shapes intersect
 boolean intersectsLinearRing(LinearRing inLinearRing)
          A MultiPoint will intersect a LinearRing if any one of the points is contained within the linear ring.
 boolean intersectsLineString(LineString inLineString)
          A MultiPoint will intersect a LineString if any one of the points intersects a verticie of the line string, or is on one of the lines.
 boolean intersectsMultiLineString(MultiLineString inMultiLineString)
          A MultiPoint will intersect a MultiLineString if any one of the points intersects one of the constituent line strings.
 boolean intersectsMultiPoint(MultiPoint inMultiPoint)
          A MultiPoint will intersect another MultiPoint if any one of the points is within the minimum distance (EQUAL_LIMIT).
 boolean intersectsMultiPolygon(MultiPolygon inMultiPolygon)
          A MultiPoint will intersect a MultiPolygon if any one of the points is contained within the MultiPolygon.
 boolean intersectsPolygon(Polygon inPolygon)
          A MUltiPoing will intersect a polygon if any one of the points is contained within the polygon.
 boolean intersectsRasterShape(RasterShape inRasterShape)
          A MultiPoint will intersect a RasterShape if any one of the points is contained within the envelope of the Raster.
 boolean remove(int inIndex)
          Removes the point at the given index from the MultiPoint.
 void setPoint(int inIndex, double inXCoordinate, double inYCoordinate)
          Set the point at the given index.
 void translate(double inXDistance, double inYDistance)
          Translate the shape the given distance in the X and Y directions
 
Methods inherited from class gistoolkit.features.Shape
contains, distance, getDistance, getDistanceToEnvelope, getDistanceToLine, getDistanceToLine, getLinesIntersect, linesIntersect, linesIntersect, pointOnLine, pointOnLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPoint

public MultiPoint()
Point constructor comment.


MultiPoint

public MultiPoint(double[] inXs,
                  double[] inYs)
Create a new multi point which contains a single point.


MultiPoint

public MultiPoint(Point[] inPoints)
Create a new multi point which contains a single point.


MultiPoint

public MultiPoint(double inX,
                  double inY)
Create a new multi point which contains a single point.

Method Detail

getXCoordinates

public double[] getXCoordinates()
Return the array of X Coordinates. This is private data, and should be used carefully.


getYCoordinates

public double[] getYCoordinates()
Return the array of Y Coordinates. This is private data, and should be used carefully.


getShapeType

public java.lang.String getShapeType()
Return the type of shape this is

Specified by:
getShapeType in class Shape

clone

public java.lang.Object clone()
Creates a copy of the MultiPoint

Specified by:
clone in class Shape

getNumPoints

public int getNumPoints()
Return the number of points in this shape.

Specified by:
getNumPoints in class Shape

getPoint

public Point getPoint(int inIndex)
Get the point at the given index.

Specified by:
getPoint in class Shape

setPoint

public void setPoint(int inIndex,
                     double inXCoordinate,
                     double inYCoordinate)
Set the point at the given index.

Specified by:
setPoint in class Shape

add

public int add(double inX,
               double inY)
Add a point to the MultiPoint returns the index of the newly added point, or -1 if it failed to add the point.

Specified by:
add in class Shape

add

public boolean add(int inIndex,
                   double inX,
                   double inY)
Adds a point to the MultiPoint at the given point index. Returns true if the add succeeded, and false if it failed.

Specified by:
add in class Shape

remove

public boolean remove(int inIndex)
Removes the point at the given index from the MultiPoint.

Specified by:
remove in class Shape

calculateEnvelope

public void calculateEnvelope()
Recalculates the envelope for the shape.

Overrides:
calculateEnvelope in class Shape

getEnvelope

public Envelope getEnvelope()
Retrieve the envelope for this shape.

Specified by:
getEnvelope in class Shape

getPoints

public Point[] getPoints()
Returns the list of points from this multi point.

Specified by:
getPoints in class Shape

getWKT

public java.lang.String getWKT()
Returns the OGIS Well Know Text Representation of this shape

Specified by:
getWKT in class Shape

getClosestPoint

public Point getClosestPoint(double inX,
                             double inY)
Return the point in the MultiPoint that is the closest to this point.


getClosestIndex

public int getClosestIndex(double inX,
                           double inY)
Return the point in the LineString that is the closest to this point.

Specified by:
getClosestIndex in class Shape

translate

public void translate(double inXDistance,
                      double inYDistance)
Translate the shape the given distance in the X and Y directions

Specified by:
translate in class Shape

getDistanceToPoint

public double getDistanceToPoint(double inX,
                                 double inY)
Get the distance from this shape to the given point

Specified by:
getDistanceToPoint in class Shape

intersects

public boolean intersects(Shape inShape)
Determines if the two shapes intersect

Specified by:
intersects in class Shape

intersectsMultiPoint

public boolean intersectsMultiPoint(MultiPoint inMultiPoint)
A MultiPoint will intersect another MultiPoint if any one of the points is within the minimum distance (EQUAL_LIMIT).


intersectsLineString

public boolean intersectsLineString(LineString inLineString)
A MultiPoint will intersect a LineString if any one of the points intersects a verticie of the line string, or is on one of the lines.


intersectsMultiLineString

public boolean intersectsMultiLineString(MultiLineString inMultiLineString)
A MultiPoint will intersect a MultiLineString if any one of the points intersects one of the constituent line strings.


intersectsLinearRing

public boolean intersectsLinearRing(LinearRing inLinearRing)
A MultiPoint will intersect a LinearRing if any one of the points is contained within the linear ring.


intersectsPolygon

public boolean intersectsPolygon(Polygon inPolygon)
A MUltiPoing will intersect a polygon if any one of the points is contained within the polygon.


intersectsMultiPolygon

public boolean intersectsMultiPolygon(MultiPolygon inMultiPolygon)
A MultiPoint will intersect a MultiPolygon if any one of the points is contained within the MultiPolygon.


intersectsRasterShape

public boolean intersectsRasterShape(RasterShape inRasterShape)
A MultiPoint will intersect a RasterShape if any one of the points is contained within the envelope of the Raster.