Open elsid opened 3 years ago
Sorry, I only just now noticed this pull request. It's generally a nice fix, but I'm not sure I like the whole thing about considering Z==0 as a missing grid. I'll have to think for a bit about how that should be flagged.
I had my own implementation for this feature. That's why I noticed this bug. I store it in my private repo but don't use it anymore. There I used a flag in TileInfo to say does it have valid height map and saved it into a map file. But I wasn't sure about bringing it here. I agree, zero height can be a problem. If there is a ridge in a tile with height zero it will not be shown on the map. Either a flag should point that grid height map is not filled or a specific default value. Also the flag can be implicitly stored via map file version.
Before you may see little holes in the ridge that are aligned with map grid image:
After there are none:
Fix is to check all tiles including 0 and sz - 1. Tile is considered to be absent if gettile returns a negative number.