@Test public void createGrid() throws Exception { final SimpleFeatureType TYPE = DataUtilities.createType("obtype", "oblong:Polygon,id:Integer"); final double SPAN = 100; final ReferencedEnvelope bounds = new ReferencedEnvelope(0, SPAN, 0, SPAN, null); class Setter extends GridFeatureBuilder { int id = 0; public Setter(SimpleFeatureType type) { super(type); } @Override public void setAttributes(GridElement el, Map<String, Object> attributes) { attributes.put("id", ++id); } } Setter setter = new Setter(TYPE); final double WIDTH = 5.0; final double HEIGHT = 10.0; SimpleFeatureSource gridSource = Oblongs.createGrid(bounds, WIDTH, HEIGHT, setter); assertNotNull(gridSource); int expectedCols = (int) (SPAN / WIDTH); int expectedRows = (int) (SPAN / HEIGHT); assertEquals(expectedCols * expectedRows, setter.id); assertEquals(setter.id, gridSource.getFeatures().size()); }
public static SimpleFeatureSource createGrid(ReferencedEnvelope bounds, double width, double height, GridFeatureBuilder gridBuilder) { return createGrid(bounds, width, height, -1.0, gridBuilder); }
Oblongs { public static SimpleFeatureSource createGrid(ReferencedEnvelope bounds, double width, double height, GridFeatureBuilder gridBuilder) { return createGrid(bounds, width, height, -1.0, gridBuilder); } }
Oblongs { public static SimpleFeatureSource createGrid(ReferencedEnvelope bounds, double width, double height, GridFeatureBuilder gridBuilder) { return createGrid(bounds, width, height, -1.0, gridBuilder); }  }
Oblongs { public static SimpleFeatureSource createGrid(ReferencedEnvelope bounds, double width, double height, GridFeatureBuilder gridBuilder) { return createGrid(bounds, width, height, -1.0, gridBuilder); }  static Oblong create(double minX, double minY, double width, double height,
            CoordinateReferenceSystem crs); static SimpleFeatureSource createGrid(ReferencedEnvelope bounds,
            double width, double height, GridFeatureBuilder gridBuilder); static SimpleFeatureSource createGrid(
            ReferencedEnvelope bounds,
            double width, double height, 
            double vertexSpacing, GridFeatureBuilder gridFeatureBuilder); }
Oblongs { public static SimpleFeatureSource createGrid(ReferencedEnvelope bounds, double width, double height, GridFeatureBuilder gridBuilder) { return createGrid(bounds, width, height, -1.0, gridBuilder); }  static Oblong create(double minX, double minY, double width, double height,
            CoordinateReferenceSystem crs); static SimpleFeatureSource createGrid(ReferencedEnvelope bounds,
            double width, double height, GridFeatureBuilder gridBuilder); static SimpleFeatureSource createGrid(
            ReferencedEnvelope bounds,
            double width, double height, 
            double vertexSpacing, GridFeatureBuilder gridFeatureBuilder);  }