|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.moximedia.aims.AimsPolygon
Implementation of an ArcIMS polygon.
| Field Summary |
| Fields inherited from interface com.moximedia.aims.AimsShapeObject |
SHAPE_TYPE_ENVELOPE, SHAPE_TYPE_MULTIPOINT, SHAPE_TYPE_POINT, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYLINE |
| Constructor Summary | |
AimsPolygon()
Creates a new polygon object with no arguments. |
|
AimsPolygon(AimsEnvelope env)
Creates a new AimsPolygon object with an AimsEnvelope object. |
|
AimsPolygon(AimsPoints pts)
Creates a new AimsPolygon object with an AimsPoints object. |
|
AimsPolygon(AimsRing ring)
Creates a new AimsPolygon object with an AimsRing object. |
|
| Method Summary | |
void |
addHole(AimsHole hole)
Adds a hole to the polygon |
AimsRing |
addRing()
Adds a new ring to the polygon, and returns the ring object. |
void |
addRing(AimsRing ring)
Adds a new ring to the polygon. |
boolean |
addVertexToClosestLineSegment(AimsPoint pt)
Adds a vertex to the closest line segment. |
protected boolean |
addVertexToSegmentAtDistance(AimsPoint pt,
double segmentDistance)
|
AimsPolygon |
buffer(double distance)
Returns a new polygon that is a buffered polygon of this one. |
java.lang.Object |
clone()
Clones this object. |
boolean |
contains(AimsPoint pt)
Tests to see if the polygon contains a point. |
boolean |
contains(AimsPolygon polygon)
|
boolean |
contains(AimsRing ring)
Tests to see if the polygon contains a ring. |
void |
densify(double distance)
Densifies the points in the shape by a distance. |
AimsPolygon |
difference(AimsPolygon polygon)
Returns a new polygon representing the difference between this polygon and another one. |
void |
fix()
Fixes a polygon where rings are added that should be holes. |
void |
generalize(double distance)
Generalizes the points in the shape by a distance. |
double |
getArea()
Returns the polygon of the polygon, in square map units. |
AimsPoint |
getClosestVertex(AimsPoint pt)
Gets the closest vertex in the AimsPolygon to the specified point. |
double |
getDistanceToClosestLineSegment(AimsPoint pt)
|
AimsEnvelope |
getExtent()
Returns the extent of the polygon, or null if the polygon has no points. |
AimsPoints |
getPoints()
Gets the edge points of the polygon, including the internal holes. |
AimsRing |
getRing(int index)
Returns the ring at the specified index. |
java.util.Vector |
getRings()
Returns the rings of the polygon as a Vector. |
int |
getShapeType()
|
boolean |
hasHoles()
Reports whether the polygon has holes. |
AimsPolygon |
intersection(AimsPolygon polygon)
Returns a new polygon representing the intersection of this polygon and another one. |
boolean |
intersects(AimsPolygon poly)
Tests whether a polygon intersects this polygon. |
boolean |
isValid()
Returns a boolean indicator of whether this shape is valid. |
static AimsPolygon |
merge(AimsPolygon polygon1,
AimsPolygon polygon2)
Deprecated. This routine does not allow polygons with holes to be merged. Use union instead. |
boolean |
movePoint(AimsPoint ptFrom,
AimsPoint ptTo)
Moves a point of the polygon (interior or exterior). |
void |
offsetBy(AimsPoint offset)
Offsets the points in the polygon by the x and y in a point. |
AimsPolygon |
project(Projection projection)
Projects this object to the specified projection. |
AimsPolygon |
project(Projection fromProjection,
Projection toProjection)
Projects this object from one projection to another. |
boolean |
removePoint(AimsPoint pt)
Removes a point from the polygon (interior or exterior). |
void |
setPoints(AimsPoints pts)
Sets the points of the polygon object. |
AimsPolygon |
symDifference(AimsPolygon polygon)
Returns a new polygon representing the difference between this polygon and another one. |
java.lang.String |
toAxlString()
Returns the AXL string to refresh this object. |
java.lang.String |
toAxlString(AimsEnvironment env)
Returns the AXL string to refresh this object. |
java.lang.String |
toGmlString()
Returns the GML text string representing this polygon. |
com.vividsolutions.jts.geom.Geometry |
toJtsGeometry()
Returns this object as a JTS Geometry object (Polygon or MultiPolygon). |
java.lang.String |
toString()
Returns a text representation of of this object. |
boolean |
touches(AimsPolygon polygon)
|
AimsPolygon |
union(AimsPolygon polygon)
Returns a new polygon representing the union of this polygon and another one. |
AimsPolygon |
unproject(Projection projection)
Unprojects this object to geographic from the specified projection. |
boolean |
within(AimsPolygon polygon)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AimsPolygon()
public AimsPolygon(AimsPoints pts)
pts - The points object.public AimsPolygon(AimsEnvelope env)
public AimsPolygon(AimsRing ring)
| Method Detail |
public int getShapeType()
getShapeType in interface AimsShapeObjectpublic AimsRing addRing()
public void addRing(AimsRing ring)
ring - The ring to add to the polygon.public double getArea()
public java.util.Vector getRings()
public AimsRing getRing(int index)
public boolean contains(AimsPoint pt)
public boolean contains(AimsRing ring)
public boolean intersects(AimsPolygon poly)
poly - Another polygon.
public AimsPoint getClosestVertex(AimsPoint pt)
pt - The point to compare the vertexes to.
public void densify(double distance)
distance - The densify distance.public void generalize(double distance)
distance - The generalize distance.public void offsetBy(AimsPoint offset)
offset - An AimsPoint object containing the offset.public void setPoints(AimsPoints pts)
public AimsPoints getPoints()
public boolean removePoint(AimsPoint pt)
pt - The point to remove,
public boolean movePoint(AimsPoint ptFrom,
AimsPoint ptTo)
ptFrom - The point to move.ptTo - Where to move it.
public double getDistanceToClosestLineSegment(AimsPoint pt)
protected boolean addVertexToSegmentAtDistance(AimsPoint pt,
double segmentDistance)
public boolean addVertexToClosestLineSegment(AimsPoint pt)
pt - The point to add to the line segment. A vertex will be added
to the portion of the line segment closest to the point position.public AimsEnvelope getExtent()
public java.lang.String toString()
public java.lang.String toAxlString()
toAxlString in interface AimsShapeObjectpublic java.lang.String toAxlString(AimsEnvironment env)
toAxlString in interface AimsShapeObjectpublic java.lang.String toGmlString()
toGmlString in interface AimsShapeObjectpublic java.lang.Object clone()
clone in interface AimsShapeObjectpublic boolean hasHoles()
public static AimsPolygon merge(AimsPolygon polygon1,
AimsPolygon polygon2)
polygon1 - The first polygon to merge.polygon2 - The second polygon to merge.
public void fix()
public void addHole(AimsHole hole)
hole - The hole to add to the polygon.public com.vividsolutions.jts.geom.Geometry toJtsGeometry()
toJtsGeometry in interface AimsShapeObjectpublic AimsPolygon buffer(double distance)
distance - The buffer distance.
public AimsPolygon difference(AimsPolygon polygon)
polygon - Another polygon to calculate the difference.
public AimsPolygon intersection(AimsPolygon polygon)
polygon - Another polygon to intersect with this one.
public AimsPolygon symDifference(AimsPolygon polygon)
polygon - Another polygon to determine difference.
public AimsPolygon union(AimsPolygon polygon)
polygon - Another polygon to union with this one.
public boolean contains(AimsPolygon polygon)
public boolean touches(AimsPolygon polygon)
public boolean within(AimsPolygon polygon)
public boolean isValid()
isValid in interface AimsShapeObject
public AimsPolygon project(Projection fromProjection,
Projection toProjection)
fromProjection - The projection of this object.toProjection - The target projection.
public AimsPolygon project(Projection projection)
projection - The original projection system.
public AimsPolygon unproject(Projection projection)
projection - The projection system.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||