gistoolkit.features
Class Point

java.lang.Object
  extended bygistoolkit.features.Shape
      extended bygistoolkit.features.Point
Direct Known Subclasses:
PointM

public class Point
extends Shape

A point is a feature that has no dimension, it only represents a point in two dimension space.


Field Summary
 double x
           
 double y
           
 
Fields inherited from class gistoolkit.features.Shape
EQUAL_LIMIT, LINEARRING, LINESTRING, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON, myEnvelope, NULLSHAPE, POINT, POLYGON, RASTER
 
Constructor Summary
Point(double inX, double inY)
          Point constructor comment.
 
Method Summary
 int add(double inX, double inY)
          Adds the point to the Shape.
 boolean add(int inIndex, double inX, double inY)
          Adds the point to the Shape.
 java.lang.Object clone()
          Creates a copy of the Point
 boolean contains(Shape inShape)
          Determines if this point contains the shape sent in; This Point can only contain the shape sent in if they are the same point.
 double distance(Point inPoint)
          Return the distance from the particular point
 boolean equals(double inX, double inY)
           
 boolean equals(java.lang.Object inObject)
           
 int getClosestIndex(double inX, double inY)
          Get the point nearest this location.
 Point getClosestPoint(double inX, double inY)
          Get the point nearest this location.
 double getDistanceToPoint(double inX, double inY)
          Get the distance from this shape to the given point
 Envelope getEnvelope()
          return the bounding rectangle of this shape.
 int getNumPoints()
          Returns the number of points in the shape.
 Point getPoint(int inIndex)
          Returns the point at the given index.
 Point[] getPoints()
          return a point array of one point for this 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 getX()
           
 double getY()
           
 boolean intersects(Shape inShape)
          Determines if the two shapes intersect
 boolean intersectsLinearRing(LinearRing inLinearRing)
          A point intersects a LinearRing if it is contained within the interior of the linear ring.
 boolean intersectsLineString(LineString inLineString)
          A point intersects a LineString if it intersects any one if the LineStrings' points, or if it is on the line between any two of the LineStrings' points.
 boolean intersectsMultiLineString(MultiLineString inMultiLineString)
          A point intersects a MultiLineString if it intersects any one of the constituent LineStrings.
 boolean intersectsMultiPoint(MultiPoint inMultiPoint)
          A point intersects a MultiPoint if it intersects any one of it's constituent points
 boolean intersectsMultiPolygon(MultiPolygon inMultiPolygon)
          A point intersects a MultiPolygon if it is contained within the MultiPolygon.
 boolean intersectsPoint(Point inPoint)
          A point intersects another point if they are within the equal limit, like an equal calculation.
 boolean intersectsPolygon(Polygon inPolygon)
          A point intersects a Polygon if it is contained within the polygon.
 boolean intersectsRasterShape(RasterShape inRasterShape)
          A point intersects a RasterShape if it is contained within the envelope of the raster shape
static boolean pointsEqual(double inX1, double inY1, double inX2, double inY2)
          A point intersects another point if they are within the equal limit, like an equal calculation.
 boolean remove(int inIndex)
          Removes the point at the given index.
 void setPoint(int inIndex, double inXCoordinate, double inYCoordinate)
          Sets the point at the given index to the given value.
 void setX(double inX)
           
 void setY(double inY)
           
 java.lang.String toString()
          Returns the string representation of this point.
 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
calculateEnvelope, distance, getDistance, getDistanceToEnvelope, getDistanceToLine, getDistanceToLine, getLinesIntersect, linesIntersect, linesIntersect, pointOnLine, pointOnLine
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y
Constructor Detail

Point

public Point(double inX,
             double inY)
Point constructor comment.

Method Detail

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 Point

Specified by:
clone in class Shape

getNumPoints

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

Specified by:
getNumPoints in class Shape

getPoint

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

Specified by:
getPoint in class Shape

setPoint

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

Specified by:
setPoint in class Shape

add

public int add(double inX,
               double inY)
Adds the point to the Shape. Always returns -1 because points can not be added to a point.

Specified by:
add in class Shape

add

public boolean add(int inIndex,
                   double inX,
                   double inY)
Adds the point to the Shape. Always returns -1 because points can not be added to a point.

Specified by:
add in class Shape

remove

public boolean remove(int inIndex)
Removes the point at the given index. Since there is only one point, this method will always return false, the point can not be removed.

Specified by:
remove in class Shape

contains

public boolean contains(Shape inShape)
Determines if this point contains the shape sent in; This Point can only contain the shape sent in if they are the same point.

Overrides:
contains in class Shape
Parameters:
inShape - features.Shape
Returns:
boolean

getEnvelope

public Envelope getEnvelope()
return the bounding rectangle of this shape.

Specified by:
getEnvelope in class Shape

getX

public double getX()

getY

public double getY()

setX

public void setX(double inX)

setY

public void setY(double inY)

equals

public boolean equals(java.lang.Object inObject)

equals

public boolean equals(double inX,
                      double inY)

toString

public java.lang.String toString()
Returns the string representation of this point. Creation date: (5/17/2001 10:16:24 AM)

Returns:
java.lang.String

getPoints

public Point[] getPoints()
return a point array of one point for this 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

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

distance

public double distance(Point inPoint)
Return the distance from the particular point


getClosestPoint

public Point getClosestPoint(double inX,
                             double inY)
Get the point nearest this location. Always returns this point.


getClosestIndex

public int getClosestIndex(double inX,
                           double inY)
Get the point nearest this location. Always returns this point.

Specified by:
getClosestIndex 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

intersectsPoint

public boolean intersectsPoint(Point inPoint)
A point intersects another point if they are within the equal limit, like an equal calculation.


pointsEqual

public static boolean pointsEqual(double inX1,
                                  double inY1,
                                  double inX2,
                                  double inY2)
A point intersects another point if they are within the equal limit, like an equal calculation.


intersectsMultiPoint

public boolean intersectsMultiPoint(MultiPoint inMultiPoint)
A point intersects a MultiPoint if it intersects any one of it's constituent points


intersectsLineString

public boolean intersectsLineString(LineString inLineString)
A point intersects a LineString if it intersects any one if the LineStrings' points, or if it is on the line between any two of the LineStrings' points.


intersectsMultiLineString

public boolean intersectsMultiLineString(MultiLineString inMultiLineString)
A point intersects a MultiLineString if it intersects any one of the constituent LineStrings.


intersectsLinearRing

public boolean intersectsLinearRing(LinearRing inLinearRing)
A point intersects a LinearRing if it is contained within the interior of the linear ring.


intersectsPolygon

public boolean intersectsPolygon(Polygon inPolygon)
A point intersects a Polygon if it is contained within the polygon.


intersectsMultiPolygon

public boolean intersectsMultiPolygon(MultiPolygon inMultiPolygon)
A point intersects a MultiPolygon if it is contained within the MultiPolygon.


intersectsRasterShape

public boolean intersectsRasterShape(RasterShape inRasterShape)
A point intersects a RasterShape if it is contained within the envelope of the raster shape