How to configure a default legend for GeoTIFFs on the Geoshare (linux)

From Tygron Support wiki
Jump to navigation Jump to search

Here are a few steps with which you can create your own GeoTIFF legend: - In the Tygron Editor, create an Overlay, open the Legend tab on the right, and click 'Copy' next to the copy-paste icon. - The JSON legend is then in your clipboard, CTRL-V in a text editor to view it.

Example: { "color" : { "argb" : -3402732 }, "entryName" : "Low", "id" : 1, "value" : 0.0 }, { "color" : { "argb" : -15414180 }, "entryName" : "High", "id" : 5, "value" : 1.0} ]

This is a very simple legend with two entries "Low" (green with value 0.0) and "High" (red with value 1.0). - Then download the ExifTool: https://exiftool.org/ (We tested Linux version, but there is also a Windows version). - With this tool you can read the tags of a Tiff (or other image) outside of Tygron.

Example: exiftool -D -G -a -u -U -f -s test.tiff You will then get all the tags information of the file. Including the current ImageDescription. - Now use the tool to change the ImageDescription tag to the new JSON legend.

Example: exiftool -ImageDescription='[ { "color" : { "argb" : -3402732 }, "entryName" : "Low", "id" : 1, "value" : 0.0 }, { "color" : { "argb" : -15414180 }, "entryName" : "High", "id" : 5, "value" : 1.0} ]' test.tiff

Make sure you use single-quotes (') at the beginning and end, if you don't do that it will cause issues with the double-quotes (") in JSON.

See also