- Mar 18, 2008
- Reaction score
Does your format allow to be extended by additional tags (e.g. by adding more lines after the first)?
I might want to add more info, such as resolution level, latitude and longitude indices (or index ranges, if the PNG is a mosaic of multiple tiles), name of the PNG file, etc.
In essence it is an arbitrary serialization of the elevation file header values. As such, I never took string values into account, so the name of the PNG file might be a problem. The idea is to have a space separated tag list in the "name=value" form, all in one line. The one-liner approach makes it more probable that editors that support PNG tags keep them alive during round-trips, like the "Comment" tag in GIMP. That same string is then simply written to a file.
"ele2png" only takes that first line into account, so the "format" (a huge term for it, really) is indeed extendable.
Small note on the min/max/mean values there: my goal was to make the ele2png round-trip consistent, so that the chain ele->png->ele will produce exact binary matches on unedited PNGs. To achieve this, I had to store the ELE min/max/mean values as presented in the original file ("smin" etc.), but also as calculated in the conversion algorithm ("emin" etc.), which did not always match in my tests. Therefore I also stored the calculated values alongside the original values, and if the re-calculation on import yields the same values as the stored calculated ones, I used the originals to create the imported ELE header.