code: public static List<TileCode> getTileCodesForBounds(TileConfiguration tileConfig, Bbox bounds, double resolution) {
  		List<TileCode> codes = new ArrayList<TileCode>();
  		if (bounds.getHeight() == 0 || bounds.getWidth() == 0) {
  			return codes;
  		}
  
  		int tileLevel = tileConfig.getResolutionIndex(resolution);
  		double actualResolution = tileConfig.getResolution(tileLevel);
  
  		double worldTileWidth = tileConfig.getTileWidth() * actualResolution;
  		double worldTileHeight = tileConfig.getTileHeight() * actualResolution;
  
  		Coordinate tileOrigin = tileConfig.getTileOrigin();
  		int ymin = (int) Math.floor((bounds.getY() - tileOrigin.getY()) / worldTileHeight);
  		int ymax = (int) Math.floor((bounds.getMaxY() - tileOrigin.getY()) / worldTileHeight);
  		int xmin = (int) Math.floor((bounds.getX() - tileOrigin.getX()) / worldTileWidth);
  		int xmax = (int) Math.floor((bounds.getMaxX() - tileOrigin.getX()) / worldTileWidth);
  
  		if (ymin < 0) {
  			ymin = 0;
  		}
  		if (xmin < 0) {
  			xmin = 0;
  		}
  		if (xmax < 0 || ymax < 0) {
  			return codes;
  		}
  
  		for (int x = xmin; x <= xmax; x++) {
  			for (int y = ymin; y <= ymax; y++) {
  				codes.add(new TileCode(tileLevel, x, y));
  			}
  		}
  		return codes;
  	}
docs: Get a list of tile codes for a certain location (bounding box).
  
  @param tileConfig The basic tile configuration.
  @param bounds     The bounds in world space (map CRS).
  @param resolution The resolution at which to search for tiles.
  @return A list of all tiles that lie within the location.