org.geotools.grid.oblong
Class OblongImpl

Object
  extended by OblongImpl
All Implemented Interfaces:
GridElement, Oblong, PolygonElement

public class OblongImpl
extends Object
implements Oblong

Default implementation of Oblong.

Since:
2.7
Author:
mbedward

Constructor Summary
OblongImpl(double minX, double minY, double width, double height, CoordinateReferenceSystem crs)
          Creates a new oblong.
 
Method Summary
 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.
 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.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OblongImpl

public OblongImpl(double minX,
                  double minY,
                  double width,
                  double height,
                  CoordinateReferenceSystem crs)
Creates a new oblong.

Parameters:
minX - minimum X ordinate
minY - minimum Y ordinate
width - span in the X direction
height - span in the Y direction
crs - coordinate reference system (may be null)
Method Detail

getArea

public double getArea()
Gets the area of this grid element.

Specified by:
getArea in interface PolygonElement
Returns:
the area

getBounds

public ReferencedEnvelope getBounds()
Gets the bounds of this grid element.

Specified by:
getBounds in interface GridElement
Returns:
the bounding rectangle

getCenter

public Coordinate getCenter()
Gets the center coordinates of this grid element.

Specified by:
getCenter in interface PolygonElement
Returns:
the center coordinates

getVertices

public Coordinate[] getVertices()
Gets the vertices of this grid element.

Vertex 0 is at the min X and Y coordinate (lower left) with the subsequent vertices being indexed clockwise.

Specified by:
getVertices in interface GridElement
Returns:
the vertices

toGeometry

public Geometry toGeometry()
Creates a new Geometry from this grid element.

Specified by:
toGeometry in interface GridElement
Returns:
a new Geometry

toDenseGeometry

public Geometry toDenseGeometry(double maxSpacing)
Creates a new, densified Geometry from this grid element.

Specified by:
toDenseGeometry in interface GridElement
Parameters:
maxSpacing - the maximum distance between adjacent vertices
Returns:
a new Geometry


Copyright © 1996-2014 Geotools. All Rights Reserved.