<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:small">Jukka,<br><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small">Have a look at Dan Stahlke's code he wrote when at GINA, I think gdal_trace_ooutline will do what you want:<br><a href="https://github.com/gina-alaska/dans-gdal-scripts">https://github.com/gina-alaska/dans-gdal-scripts</a><br><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small">Thomas<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 10:48 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le mardi 13 octobre 2015 13:19:50, Jukka Rahkonen a écrit :<br>
> Hi,<br>
><br>
> This question appears every now and then in the gis.stackexchange and I<br>
> have been wondering about it by myself as well: How to generate a<br>
> footprint polygon of the real image data area so that the possible nodata<br>
> areas would not be included?<br>
><br>
> I have been thinking that I could convert the original image into a new<br>
> image with alpha channel or a one-bit image with nodata=0 and yesdata=1 and<br>
> then polygonize the alpha band or the 1-bit image with gdal_polygonize.py.<br>
<br>
</span>You can get the image to polygonize with :<br>
gdal_translate in.tif mask.tif -b mask<br>
<br>
That should work with images with nodata or alpha channel.<br>
<span class=""><br>
> I guess that it would work but it feels a bit complicated. Is there any<br>
> more direct way for doing this task with GDAL?<br>
<br>
</span>None that I can think of.<br>
<br>
gdal_polygonize.py would possibly do a bit more work than really needed in<br>
case there are holes of nodata inside the raster and you're not interested in<br>
such holes.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><i><font color="#999999" face="georgia, serif">The right coordinate system can turn an impossible problem into two really hard problems. -- Charlie Pellerin</font></i><div><i><font color="#999999"><br></font></i><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#999999">Thomas Juntunen</font></span><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#999999">GIS Specialist</font></span></div><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#999999">Polar Geospatial Center<br>R280 Learning and Environmental Science<br>1954 Buford Ave<br>University of Minnesota<br>St. Paul, MN 55108<br><a>612-626-0505</a></font></span></div></div></div></div>
</div>