Package org.geotools.grid.oval
Class Ovals
Object
Ovals
A utility class with static methods to create and work with oval grid elements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Oval
create
(double minX, double minY, double width, double height, CoordinateReferenceSystem crs) Creates a newOval
object.static SimpleFeatureSource
createGrid
(ReferencedEnvelope bounds, double width, double height, double vertexSpacing, GridFeatureBuilder gridFeatureBuilder) Creates a new grid of oblongs within a bounding rectangle with grid elements represented by densified polygons (ie. additional vertices added to each edge).static SimpleFeatureSource
createGrid
(ReferencedEnvelope bounds, double width, double height, GridFeatureBuilder gridBuilder) Creates a new grid of oblongs within a bounding rectangle with grid elements represented by simple (ie.
-
Constructor Details
-
Ovals
public Ovals()
-
-
Method Details
-
create
public static Oval create(double minX, double minY, double width, double height, CoordinateReferenceSystem crs) Creates a newOval
object.- Parameters:
minX
- the min X ordinateminY
- the min Y ordinatewidth
- the widthheight
- the heightcrs
- the coordinate reference system (may benull
)- Returns:
- a new
Oval
object - Throws:
IllegalArgumentException
- if eitherwidth
orheight
are<=
0
-
createGrid
public static SimpleFeatureSource createGrid(ReferencedEnvelope bounds, double width, double height, GridFeatureBuilder gridBuilder) Creates a new grid of oblongs within a bounding rectangle with grid elements represented by simple (ie. undensified) polygons.- Parameters:
bounds
- the bounding rectanglewidth
- oblong widthheight
- oblong heightgridBuilder
- an instance ofGridFeatureBuilder
- Returns:
- a new grid
- Throws:
IllegalArgumentException
- if bounds is null or empty; or if either width or height is<=
0; or if theCoordinateReferenceSystems
set for the bounds and theGridFeatureBuilder
are both non-null but different
-
createGrid
public static SimpleFeatureSource createGrid(ReferencedEnvelope bounds, double width, double height, double vertexSpacing, GridFeatureBuilder gridFeatureBuilder) Creates a new grid of oblongs within a bounding rectangle with grid elements represented by densified polygons (ie. additional vertices added to each edge).- Parameters:
bounds
- the bounding rectanglewidth
- oblong widthheight
- oblong heightvertexSpacing
- maximum distance between adjacent vertices in a grid element; if<= 0
or>= min(width, height) / 2.0
it is ignored and the polygons will not be densifiedgridFeatureBuilder
- an instance ofGridFeatureBuilder
- Returns:
- the vector grid
- Throws:
IllegalArgumentException
- if bounds is null or empty; or if either width or height is<=
0; or if theCoordinateReferenceSystems
set for the bounds and theGridFeatureBuilder
are both non-null but different
-