Thanks Brian,<br><br>I will give your suggestion a try.<br><br>Going back to the original post, I have made some progress with compressing the output of gdal2tiles to a kmz file.  The resulting kmz file opens in Google Earth as red X&#39;s.  It appears to be an issue with 7zip, because I am able to compress the same folder structure using the compression tool in Windows 7 and the kmz file opens in Google Earth as it should (and the transparency is correct).  I just have posted my experience to the 7zip forum to see if that group is aware of any issues with creating kmz files using 7zip.<br>
<br>Thanks,<br>Roland<br>  <br><br><div class="gmail_quote">On Wed, Feb 23, 2011 at 5:41 PM, brian <span dir="ltr">&lt;<a href="mailto:rush@winkey.org">rush@winkey.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Roland<br>
<br>
it is probably worth your time to include another step in in your<br>
proccess<br>
<br>
run nearblack -setmask -near 0 -nb 0 -of GTiff infile -o nearblack.tif<br>
<br>
nearblack options change if the source is a white background and if the<br>
image format is lossy<br>
<br>
gdalwarp -dstalpha -t_srs &quot;EPSG:4326 nearblack.tif warped.tif<br>
<br>
gdal_translate -of kmlsuperoverlay warped.tif final.kmz<br>
<font color="#888888"><br>
brian<br>
</font><div><div></div><div class="h5"><br>
On Tue, 2011-02-22 at 15:38 -0500, Roland Duhaime wrote:<br>
&gt; I have been working with the png creation option under &quot;gdal_translate<br>
&gt; -of kmlsuperoverlay&quot; to create kmz files that include transparency.  I<br>
&gt; haven&#39;t had much luck with controlling specific colors that becomes<br>
&gt; transparent, or even maintaining transparency in the source HFA file.<br>
&gt; The handling of transparency is different from gdal2tiles, where I<br>
&gt; have had good results.  This leads me back to gdal2tiles and<br>
&gt; attempting to create a kmz file from the tile structure.  The key<br>
&gt; difference I see between the .kml files using the two different<br>
&gt; processes is below.   In order to be able to compress the gdal2tiles<br>
&gt; output into one file, I believe that I may need to modify<br>
&gt; gdal2tiles.py to create the gx:LatLonQuad tag from section 1 below as<br>
&gt; opposed to the LatLonBox from section 2 below.  Does anyone know the<br>
&gt; difference between gx:LatLonQuad and LatLonBox before I decide if this<br>
&gt; change is appropriate?:<br>
&gt;<br>
&gt; (1) KML Superoverlay snippet:<br>
&gt;<br>
&gt;         &lt;GroundOverlay&gt;<br>
&gt;             &lt;drawOrder&gt;0&lt;/drawOrder&gt;<br>
&gt;             &lt;Icon&gt;<br>
&gt;                 &lt;href&gt;0.png&lt;/href&gt;<br>
&gt;             &lt;/Icon&gt;<br>
&gt;             &lt;gx:LatLonQuad&gt;<br>
&gt;                 &lt;coordinates&gt;<br>
&gt;                     -74.885604, 40.373168, 0<br>
&gt;                     -74.269963, 40.373582, 0<br>
&gt;                     -74.267506, 41.083329, 0<br>
&gt;                     -74.889723, 41.082904, 0<br>
&gt;                 &lt;/coordinates&gt;<br>
&gt;             &lt;/gx:LatLonQuad&gt;<br>
&gt;         &lt;/GroundOverlay&gt;<br>
&gt;<br>
&gt; (2)GDAL2Tiles Kml snippet:<br>
&gt;<br>
&gt;         &lt;GroundOverlay&gt;<br>
&gt;           &lt;drawOrder&gt;16&lt;/drawOrder&gt;<br>
&gt;           &lt;Icon&gt;<br>
&gt;             &lt;href&gt;159.png&lt;/href&gt;<br>
&gt;           &lt;/Icon&gt;<br>
&gt;           &lt;LatLonBox&gt;<br>
&gt;             &lt;north&gt;40.97989806962016&lt;/north&gt;<br>
&gt;             &lt;south&gt;39.90973623453719&lt;/south&gt;<br>
&gt;             &lt;east&gt;-74.53125000000000&lt;/east&gt;<br>
&gt;             &lt;west&gt;-75.93750000000000&lt;/west&gt;<br>
&gt;           &lt;/LatLonBox&gt;<br>
&gt;         &lt;/GroundOverlay&gt;<br>
&gt;<br>
&gt; Thanks Again,<br>
&gt; Roland<br>
&gt;<br>
&gt;<br>
&gt; On Sun, Feb 20, 2011 at 6:12 AM, Vadim Shlyakhov &lt;<a href="mailto:vadp.devl@gmail.com">vadp.devl@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;         brian &lt;rush &lt;at&gt; <a href="http://winkey.org" target="_blank">winkey.org</a>&gt; writes:<br>
&gt;<br>
&gt;         &gt; the problem is in /12/1211/2558.kml line 26<br>
&gt;         &gt;<br>
&gt;         &gt; &lt;href&gt;2558.png&lt;/href&gt;<br>
&gt;         &gt;<br>
&gt;         &gt; this should be a relative path from the root of the zipfile<br>
&gt;         not from<br>
&gt;         &gt; 2558.kml<br>
&gt;         &gt;<br>
&gt;<br>
&gt;<br>
&gt;         Hello Brian,<br>
&gt;<br>
&gt;         I&#39;ve made another tile cutter<br>
&gt;         (<a href="http://code.google.com/p/tilers-tools/" target="_blank">http://code.google.com/p/tilers-tools/</a>). It<br>
&gt;         produces a directory tree in a manner which is very similar to<br>
&gt;         gdal2tiles.py. So<br>
&gt;         I had a look into this problem.<br>
&gt;<br>
&gt;         I must say it didn&#39;t work for me either: GE shows KML just<br>
&gt;         fine, but if I zip a<br>
&gt;         dir tree into KMZ it fails altogether. I&#39;ve tried relative<br>
&gt;         paths to PNGs, to<br>
&gt;         internal KMLs. All these were to no avail.<br>
&gt;<br>
&gt;         I think that the problem actually lies in &#39;&lt;NetworkLink&gt;&#39;<br>
&gt;         things and I still<br>
&gt;         cannot get a clue on these.<br>
&gt;<br>
&gt;         I wonder if you have (or can produce manually) a sample of<br>
&gt;         working KMZ with<br>
&gt;         superoverlays, so I&#39;d be able to have a look<br>
&gt;<br>
&gt;<br>
&gt;         _______________________________________________<br>
&gt;         gdal-dev mailing list<br>
&gt;         <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt;         <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; gdal-dev mailing list<br>
&gt; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
</div></div></blockquote></div><br>