|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgistoolkit.features.Shape
gistoolkit.features.Polygon
A Polygon is a group of rings, the first represents the external polygin, there may be zero or more holes as well.
Field Summary |
Fields inherited from class gistoolkit.features.Shape |
EQUAL_LIMIT, LINEARRING, LINESTRING, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON, myEnvelope, NULLSHAPE, POINT, POLYGON, RASTER |
Constructor Summary | |
Polygon()
Polygon constructor comment. |
|
Polygon(LinearRing inLinearRing)
Create a new linear ring from the points. |
|
Polygon(LinearRing inLinearRing,
LinearRing[] inHoles)
Create a new linear ring from the points. |
Method Summary | |
int |
add(double inX,
double inY)
Add the a point to this shape. |
boolean |
add(int inIndex,
double inX,
double inY)
Adds the point to this shape at the given index. |
void |
addHole(int inIndex,
LinearRing inLinearRing)
Add a hole at the given index. |
void |
calculateEnvelope()
Calculates the envelope based on the data in the polygon. |
java.lang.Object |
clone()
Creates a copy of the Polygon |
boolean |
contains(Shape inShape)
returns true if any of the contained polygons contain this shape. |
Point |
getCentroid()
Find a point within the polygon . |
int |
getClosestIndex(double inX,
double inY)
Return the index of the point in the polygon that is the closest to this point. |
Point |
getClosestPoint(double inX,
double inY)
Return the point in the polygon 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()
return the bounding rectangle of this shape. |
LinearRing[] |
getHoles()
Return the negative rings. |
int |
getNumPoints()
Return the number of points in this shape. |
Point |
getPoint(int inIndex)
Get the point at the given index. |
Point[] |
getPoints()
Return the points that comprise the object |
LinearRing |
getPosativeRing()
Return the posative Polygon from the shape. |
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 |
boolean |
intersects(Shape inShape)
Determines if the two shapes intersect |
boolean |
intersectsMultiPolygon(MultiPolygon inMultiPolygon)
A Polygon intersects a MultiPolygon if it intersects any of the MultiPolygon's constituent Polygons. |
boolean |
intersectsPolygon(Polygon inPolygon)
A polygon intersects another polygon if any of the rings of the polygon intersect, or one polygon is contained within the other. |
boolean |
intersectsRasterShape(RasterShape inRasterShape)
A Polygon intersects a RasterShape if it intersects any of the envelope, or if it is contained within the envelope. |
static boolean |
isPointInPolygon(Polygon inPolygon,
Point inPoint)
Performs a point in polygon calculation. |
static boolean |
isPointInRing(LinearRing inRing,
Point inPoint)
Performs a point in polygon calculation. |
boolean |
remove(int inIndex)
Delete the given point from the polygon. |
void |
removeHole(int inIndex)
Remove a hole at the given index. |
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 |
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 |
public Polygon()
public Polygon(LinearRing inLinearRing)
public Polygon(LinearRing inLinearRing, LinearRing[] inHoles)
Method Detail |
public java.lang.String getShapeType()
getShapeType
in class Shape
public int getNumPoints()
getNumPoints
in class Shape
public Point getPoint(int inIndex)
getPoint
in class Shape
public void setPoint(int inIndex, double inXCoordinate, double inYCoordinate)
setPoint
in class Shape
public int add(double inX, double inY)
add
in class Shape
public boolean add(int inIndex, double inX, double inY)
add
in class Shape
public boolean remove(int inIndex)
remove
in class Shape
public void calculateEnvelope()
calculateEnvelope
in class Shape
public Envelope getEnvelope()
Shape
getEnvelope
in class Shape
public java.lang.Object clone()
clone
in class Shape
public boolean contains(Shape inShape)
contains
in class Shape
public LinearRing[] getHoles()
public void addHole(int inIndex, LinearRing inLinearRing)
public void removeHole(int inIndex)
public LinearRing getPosativeRing()
public static boolean isPointInPolygon(Polygon inPolygon, Point inPoint)
public static boolean isPointInRing(LinearRing inRing, Point inPoint)
public Point[] getPoints()
getPoints
in class Shape
public java.lang.String getWKT()
getWKT
in class Shape
public void translate(double inXDistance, double inYDistance)
translate
in class Shape
public Point getClosestPoint(double inX, double inY)
public int getClosestIndex(double inX, double inY)
getClosestIndex
in class Shape
public double getDistanceToPoint(double inX, double inY)
getDistanceToPoint
in class Shape
public boolean intersects(Shape inShape)
intersects
in class Shape
public boolean intersectsPolygon(Polygon inPolygon)
public boolean intersectsMultiPolygon(MultiPolygon inMultiPolygon)
public boolean intersectsRasterShape(RasterShape inRasterShape)
public Point getCentroid()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |