Class Oblongs


  • public class Oblongs
    extends Object
    A utility class with static methods to create and work with oblong grid elements.
    Since:
    2.7
    Author:
    mbedward
    • Constructor Detail

      • Oblongs

        public Oblongs()
    • Method Detail

      • create

        public static Oblong create​(double minX,
                                    double minY,
                                    double width,
                                    double height,
                                    CoordinateReferenceSystem crs)
        Creates a new Oblong object.
        Parameters:
        minX - the min X ordinate
        minY - the min Y ordinate
        width - the width
        height - the height
        crs - the coordinate reference system (may be null)
        Returns:
        a new Oblong object
        Throws:
        IllegalArgumentException - if either width or height 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 rectangle
        width - oblong width
        height - oblong height
        gridBuilder - an instance of GridFeatureBuilder
        Returns:
        a new grid
        Throws:
        IllegalArgumentException - if bounds is null or empty; or if either width or height is <= 0; or if the CoordinateReferenceSystems set for the bounds and the GridFeatureBuilder 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 rectangle
        width - oblong width
        height - oblong height
        vertexSpacing - 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 densified
        gridFeatureBuilder - an instance of GridFeatureBuilder
        Returns:
        the vector grid
        Throws:
        IllegalArgumentException - if bounds is null or empty; or if either width or height is <= 0; or if the CoordinateReferenceSystems set for the bounds and the GridFeatureBuilder are both non-null but different