82 | | == create overviews == |
| 84 | == Mark void Pixel as NODATA == |
| 85 | |
| 86 | If you have textures which are not completely filled with data, GDAL has to detect which part of the texture is void and which is regular texture data. Therefore you can save the NODATA placeholder into the file so the reader knows how to interpret this data. |
| 87 | Usually nodata Pixels in textures are saved as black pixel (RBG=0,0,0). This works fine even without a valid NODATA entry, because VPB/GDAL checks for the black texture pixels, which are unlikely to be a valid texture part. |
| 88 | The situation is different if you want to add overviews to reduce the compile time of your database: If the pixels are not marked as void pixel by setting the NODATA flag, the overview interpolation algorithm will include the black pixels into the calculation. |
| 89 | This causes the valid pixels on the edge to the NODATA pixels to be interpolated with the black (the NODATA) pixels and they are darken. Because they are not completely black they won't be excluded by VPB/Gdal and your Hi-Res inlay to be surrounded with a thin black line. |
| 90 | |
| 91 | If you zoom into the scene near enough to see a VPB-tile created from the original image and not from an overview the black border will disappear. |
| 92 | |
| 93 | To avoid the described problem, you should ensure that all void data in your textures has a well defined value which you can set as NODATA value. |
| 94 | This is an example script to set the NODATA value to black (0,0,0): |
| 95 | {{{ |
| 96 | cat compressNdefineNODATA.sh |
| 97 | |
| 98 | #!/bin/bash |
| 99 | cd /home/user/your/path/to/imagery |
| 100 | for file in `dir -d *` ; do |
| 101 | echo "$file :" |
| 102 | /usr/bin/gdal_translate -of GTiff -co "COMPRESS=LZW" -a_nodata 0 $file nodata/$file |
| 103 | done |
| 104 | }}} |
| 105 | |
| 106 | == create Overviews == |