code: public static Coordinate snapToNextHigherInRegionResolution( double x, double y, JGTProcessingRegion region ) {
  
          double minx = region.getRectangle().getBounds2D().getMinX();
          double ewres = region.getWEResolution();
          double xsnap = minx + (Math.ceil((x - minx) / ewres) * ewres);
  
          double miny = region.getRectangle().getBounds2D().getMinY();
          double nsres = region.getNSResolution();
          double ysnap = miny + (Math.ceil((y - miny) / nsres) * nsres);
  
          return new Coordinate(xsnap, ysnap);
  
      }
docs: Snaps a geographic point to be on the region grid.
  
  <p>
  Moves the point given by X and Y to be on the grid of the supplied
  region.
  </p>
  
  @param x
  the easting of the arbitrary point.
  @param y
  the northing of the arbitrary point.
  @param region
  the active window from which to take the grid.
  @return the snapped coordinate.