You know there is a forumla in the documentation for this?
Width and Height
(meters * 100) / resolution
There are also very specific resolutions you should be using.
1024 is NOT a valid resolution for a height map 1009 is.
All the information is detailed here
Therefore if you have an 8K resolution map which is an 8129x8129 resolution height map. And you want your terrain to be 8Km squared
The formula is 8000 * 100 / 8129 or 800000/8129 or 98.413088940 scale
There is also a formula for the height which is
(meters * 100) / 512 the 512 is the maximum resolution for the height.