Exemplo n.º 1
0
 /**
  * Compute the polygon corresponding to the cell
  *
  * @return Polygon of the cell
  */
 private Polygon getCellPolygon() {
   final Coordinate[] summits = new Coordinate[5];
   double x1 = minX + cellI * deltaX;
   double y1 = minY + cellJ * deltaY;
   double x2 = minX + (cellI + 1) * deltaX;
   double y2 = minY + (cellJ + 1) * deltaY;
   summits[0] = new Coordinate(x1, y1);
   summits[1] = new Coordinate(x2, y1);
   summits[2] = new Coordinate(x2, y2);
   summits[3] = new Coordinate(x1, y2);
   summits[4] = new Coordinate(x1, y1);
   final LinearRing g = GF.createLinearRing(summits);
   final Polygon gg = GF.createPolygon(g, null);
   cellI++;
   return gg;
 }