<div dir="ltr">Jukka,<div><br></div><div>Yes, I've written the Python script to do this. If you're willing to install Rasterio (which is GDAL and underneath, but new bindings and not osgeo.gdal) you can use its rio-shapes command (based on GDAL's polygonizer):</div><div><br></div><div><a href="https://github.com/mapbox/rasterio/blob/master/docs/cli.rst#shapes">https://github.com/mapbox/rasterio/blob/master/docs/cli.rst#shapes</a><br></div><div><br></div><div>The script's entry point is at <a href="https://github.com/mapbox/rasterio/blob/master/rasterio/rio/features.py#L197">https://github.com/mapbox/rasterio/blob/master/rasterio/rio/features.py#L197</a>. You're welcome to port it to GDAL's Python bindings; swapping out rasterio and swapping in osgeo.gdal wouldn't be terribly hard.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 5:19 AM, Jukka Rahkonen <span dir="ltr"><<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
This question appears every now and then in the gis.stackexchange and I have<br>
been wondering about it by myself as well: How to generate a footprint<br>
polygon of the real image data area so that the possible nodata areas would<br>
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. I<br>
guess that it would work but it feels a bit complicated. Is there any more<br>
direct way for doing this task with GDAL? I bet that at least someone has<br>
written a python script for it because the need is so obvious.<br>
<br>
-Jukka Rahkonen-<br>
<br>
_______________________________________________<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></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Sean Gillies</div></div>
</div>