Ocean tiles are 0 just by accident. The code just converts the digital elevation into segments. If the first segment is sea, then it will be sea. In my code, I then remember a signature for each segment, and if I see another segment identical, I just reuse the index again.quote:Originally posted by Skyfire76:
Yes, but I suspect there could be something like full ocean region should always be at the beginning of L2 file, or something like that.
So it goes something like
generate a segment,
make a signature of it (gives a unique number based on the segment)
compare this to other segments generated.
If its the same as another segment, insert this reference into the O2 file
Else add new segment to the end of the L2 file, and point to this new segment from the O2.
move on to next segment
Mostly this means that all sea only tiles are shared, a very few others are shared, although it might be the case for some (like desert perhaps).
Sea only tiles will only be 0 if the first segment of the terrain happens to be sea, I think this is not the case for ODS for instance.
Julian.