|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.GeoPolygon
public class GeoPolygon
A container for a polygon composed of GeoPoints
Constructor Summary | |
---|---|
GeoPolygon(double[][] gp)
Point constructor |
|
GeoPolygon(float[][] gp)
Point constructor |
|
GeoPolygon(GeoPoint... gp)
Point constructor |
|
GeoPolygon(GeoPointProvider... gpp)
Point constructor |
|
GeoPolygon(GeoPolygon other)
Copy constructor |
|
GeoPolygon(java.util.List<GeoPoint> gpList)
Point constructor |
|
GeoPolygon(java.lang.String name,
double[][] gp)
Name/point constructor |
|
GeoPolygon(java.lang.String name,
float[][] gp)
Name/point constructor |
|
GeoPolygon(java.lang.String name,
GeoPoint... gp)
Name/point constructor |
|
GeoPolygon(java.lang.String name,
java.util.List<GeoPoint> gpList)
Name/point constructor |
Method Summary | |
---|---|
void |
addGeoPoint(GeoPoint gp)
Add point to polygon |
void |
addNegativeRing(GeoPolygon geoPoly)
Adds an inner polygon which is defines an area which is not part of the outer polygon. No validation is performed to ensure that the specified polygon is a propper inner polygon. |
void |
addNegativeRings(java.util.Collection<GeoPolygon> geoPolyList)
Adds an inner polygon which is defines an area which is not part of the outer polygon. No validation is performed to ensure that the specified polygon is a propper inner polygon. |
java.lang.Object |
clone()
Shallow copy |
boolean |
closePolygon()
Closes this GeoPolygon (making sure last point is equal to first point) |
static GeoPoint[] |
closePolygon(GeoPoint[] gp)
Closes the polygon represented by the list of points |
boolean |
containsPoint(GeoPoint gp)
Returns true if the specified point is inside the polygon, same as isPointInside() |
static boolean |
containsPoint(GeoPoint gp,
GeoPoint... pp)
Returns true if the specified point is inside the polygon formed by a specified list of points, same as isPointInside() NOTE: The list of points MUST represent a closed polygon. |
GeoBounds |
getGeoBounds()
Gets the GeoBounds of this GeoPolygon |
GeoPoint |
getGeoPoint(int gpi)
Return the GeoPoint at the specified index |
GeoPoint[] |
getGeoPoints()
Return the array of points that make up the polygon |
static GeoPoint[] |
getGeoPoints(GeoPolygon geoPoly)
Return the array of GeoPoints from the specified GeoPolygon |
static GeozoneChecker |
getGeozoneChecker()
Gets a GeozoneChecker implemtation |
java.lang.String |
getName()
Gets the name of the polygon |
java.util.List<GeoPolygon> |
getNegativeRings()
Gets the list of inner negative rings |
java.lang.String |
getPointCountString()
Gets a String representation of the number of points this polygon contains. |
int |
getSize()
Return the number of points in the polygon |
boolean |
hasNegativeRings()
Returns true if this GeoPolygon has negative rings |
void |
insertGeoPoint(GeoPoint gp,
int ndx)
Insert point into polygon |
boolean |
isClockwise()
Returns true if the points in this polygon are oriented clockwise. |
static boolean |
isClockwise(GeoPoint... pp)
Returns true if the points in this polygon are oriented clockwise. |
boolean |
isClosed()
Returns true if this polygon is closed |
static boolean |
isClosed(GeoPoint[] gp)
Returns true if the specified points represent a closed polygon |
boolean |
isEmpty()
Return true if this polygon is empty |
boolean |
isPointInside(GeoPoint gp)
Returns true if the specified point is inside the polygon |
static boolean |
isPointInside(GeoPoint gp,
GeoPoint... pp)
Returns true if the specified point is inside the polygon formed by a specified list of points NOTE: The list of points MUST represent a closed polygon. |
boolean |
isValid()
Return true if this polygon is valid |
static void |
main(java.lang.String[] argv)
Main entry point for testing/debugging |
static GeoPolygon |
parseGeoPolygon(java.lang.String polyStr)
|
void |
setName(java.lang.String name)
Sets the name of the polygon |
int |
size()
|
java.lang.String |
toString()
Returns a String representation of this class. Currently, this simply includes the number of points this polygon contains. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeoPolygon(GeoPoint... gp)
gp
- A list of GeoPointspublic GeoPolygon(GeoPointProvider... gpp)
gpp
- A list of GeoPointProviderspublic GeoPolygon(java.util.List<GeoPoint> gpList)
gpList
- A list of GeoPointspublic GeoPolygon(float[][] gp)
gp
- An array of lattitude/longitude pairspublic GeoPolygon(double[][] gp)
gp
- An array of lattitude/longitude pairspublic GeoPolygon(java.lang.String name, GeoPoint... gp)
name
- The name of the polygongp
- A list of GeoPointspublic GeoPolygon(java.lang.String name, java.util.List<GeoPoint> gpList)
name
- The name of the polygongpList
- A list of GeoPointspublic GeoPolygon(java.lang.String name, float[][] gp)
name
- The name of the polygongp
- An array of lattitude/longitude pairspublic GeoPolygon(java.lang.String name, double[][] gp)
name
- The name of the polygongp
- An array of lattitude/longitude pairspublic GeoPolygon(GeoPolygon other)
Method Detail |
---|
public static GeoPolygon parseGeoPolygon(java.lang.String polyStr)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name of the polygonpublic boolean isEmpty()
public boolean isValid()
public static GeoPoint[] getGeoPoints(GeoPolygon geoPoly)
geoPoly
- The GeoPolygon
public GeoPoint[] getGeoPoints()
public GeoPoint getGeoPoint(int gpi)
gpi
- The GeoPoint index
public void insertGeoPoint(GeoPoint gp, int ndx)
gp
- The point to insert into the polygonndx
- The index to insert the point atpublic void addGeoPoint(GeoPoint gp)
gp
- The point to add to the polygonpublic static boolean isClosed(GeoPoint[] gp)
gp
- The set of points representing a polygon
public boolean isClosed()
public static GeoPoint[] closePolygon(GeoPoint[] gp)
public boolean closePolygon()
public GeoBounds getGeoBounds()
public int getSize()
public int size()
getSize()
public boolean containsPoint(GeoPoint gp)
isPointInside()
gp
- The point to check if is inside the polygon
isPointInside(GeoPoint gp)
public boolean isPointInside(GeoPoint gp)
gp
- The point to check if is inside the polygon
public static boolean containsPoint(GeoPoint gp, GeoPoint... pp)
isPointInside()
gp
- The point to check if is inside the polygon
isPointInside(GeoPoint gp, GeoPoint... pp)
public static boolean isPointInside(GeoPoint gp, GeoPoint... pp)
gp
- The point to check if is inside the polygon
public boolean isClockwise()
public static boolean isClockwise(GeoPoint... pp)
pp
- The GeoPoints comprising the polygon
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getPointCountString()
public java.lang.String toString()
toString
in class java.lang.Object
public void addNegativeRings(java.util.Collection<GeoPolygon> geoPolyList)
geoPolyList
- The inner negative ringspublic void addNegativeRing(GeoPolygon geoPoly)
geoPoly
- The inner negative ringpublic java.util.List<GeoPolygon> getNegativeRings()
public boolean hasNegativeRings()
public static GeozoneChecker getGeozoneChecker()
public static void main(java.lang.String[] argv)
argv
- Comand-line arguments
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |