Package org.geotools.grid.oval
Class Ovals
- Object
-
- Ovals
-
public class Ovals extends Object
A utility class with static methods to create and work with oval grid elements.
-
-
Constructor Summary
Constructors Constructor Description Ovals()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Ovalcreate(double minX, double minY, double width, double height, CoordinateReferenceSystem crs)Creates a newOvalobject.static SimpleFeatureSourcecreateGrid(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 SimpleFeatureSourcecreateGrid(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.
-
-
-
Method Detail
-
create
public static Oval create(double minX, double minY, double width, double height, CoordinateReferenceSystem crs)
Creates a newOvalobject.- Parameters:
minX- the min X ordinateminY- the min Y ordinatewidth- the widthheight- the heightcrs- the coordinate reference system (may benull)- Returns:
- a new
Ovalobject - Throws:
IllegalArgumentException- if eitherwidthorheightare<=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 theCoordinateReferenceSystemsset for the bounds and theGridFeatureBuilderare 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<= 0or>= min(width, height) / 2.0it 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 theCoordinateReferenceSystemsset for the bounds and theGridFeatureBuilderare both non-null but different
-
-