Heightmap tile size and water values

Good afternoon.

Could you help me please.

The first question
In the format description http://cesiumjs.org/data-and-assets/terrain/formats/heightmap-1.0.html says that the size of the height map is 65 * 65.
If the tile has a mix of land and water, it is necessary to fill the additional mask with size of 256 * 256.
I do not understand which the size of the tile: 65*65 or 256*256.
I have two choices:
1) tile size is 256 * 256, and a height map is constructed by decimation;
2) tile size is 65 * 65, and the mask is constructed by interpolating.

The second question
How to distinguish between land and water?
Do I understand correctly that if the pixel value on the tile is less or equal to zero, this point corresponds to the water, otherwise it corresponds to the land?

I can help you for the second question: a value of 255 (maximum) means it's water, a value of 0 (minimum) means it's land. It's a ramp between these extrems.

I made same reflexion about your first question. I'll also need more precisions because it seems that watermask array had changed in cesium 1.1 updates...

Thank you, I know it.
I want to create a pyramid of tiles in this format(heightmap) from my source data. I need to know how to convert the source height data values to the water/land mask.

I think that the algorithm has to be very simple and the translation must be carried out according to the rule described above from me. But I'm not sure that it's right.


Have you checked https://github.com/geo-data/cesium-terrain-builder ?
They do not support water mask right yet but it may be a good start for
you and surely a welcomed contribution.

Hello Guillaume.

I saw this program, but I have my own programm for the tiling, which can generate the necessary pyramid of tiles. I only need to add support of the new format.