public class HexagonImpl extends Object implements Hexagon
Hexagon
.Constructor and Description |
---|
HexagonImpl(double minX,
double minY,
double sideLen,
HexagonOrientation orientation,
CoordinateReferenceSystem crs)
Creates a new hexagon.
|
Modifier and Type | Method and Description |
---|---|
double |
getArea()
Gets the area of this grid element.
|
ReferencedEnvelope |
getBounds()
Gets the bounds of this grid element.
|
Coordinate |
getCenter()
Gets the center coordinates of this grid element.
|
HexagonOrientation |
getOrientation()
Gets the orientation of this hexagon.
|
double |
getSideLength()
Gets the side length of this hexagon.
|
Coordinate[] |
getVertices()
Gets the vertices of this grid element.
|
Geometry |
toDenseGeometry(double maxSpacing)
Creates a new, densified
Geometry from this grid element. |
Geometry |
toGeometry()
Creates a new
Geometry from this grid element. |
public HexagonImpl(double minX, double minY, double sideLen, HexagonOrientation orientation, CoordinateReferenceSystem crs)
minX
- the min X ordinate of the bounding rectangleminY
- the min Y ordinate of the bounding rectanglesideLen
- the side lengthorientation
- either Hexagon.Orientation.FLAT
or Hexagon.Orientation.ANGLED
crs
- the coordinate reference system (may be null
)public double getSideLength()
getSideLength
in interface Hexagon
public double getArea()
getArea
in interface PolygonElement
public HexagonOrientation getOrientation()
getOrientation
in interface Hexagon
public Coordinate[] getVertices()
getVertices
in interface GridElement
Coordinates
public ReferencedEnvelope getBounds()
getBounds
in interface GridElement
public Coordinate getCenter()
getCenter
in interface PolygonElement
public Geometry toGeometry()
Geometry
from this grid element.toGeometry
in interface GridElement
Geometry
public Geometry toDenseGeometry(double maxSpacing)
Geometry
from this grid element.toDenseGeometry
in interface GridElement
maxSpacing
- the maximum distance between adjacent verticesGeometry
IllegalArgumentException
- if maxSpacing
is not a positive valueCopyright © 1996–2019 Geotools. All rights reserved.