Jukka, Have a look at Dan Stahlke's code he wrote when at GINA, I think gdal_trace_ooutline will do what you want: https://github.com/gina-alaska/dans-gdal-scripts
Thomas On Tue, Oct 13, 2015 at 10:48 AM, Even Rouault <[email protected]> wrote: > Le mardi 13 octobre 2015 13:19:50, Jukka Rahkonen a écrit : > > Hi, > > > > This question appears every now and then in the gis.stackexchange and I > > have been wondering about it by myself as well: How to generate a > > footprint polygon of the real image data area so that the possible nodata > > areas would not be included? > > > > I have been thinking that I could convert the original image into a new > > image with alpha channel or a one-bit image with nodata=0 and yesdata=1 > and > > then polygonize the alpha band or the 1-bit image with > gdal_polygonize.py. > > You can get the image to polygonize with : > gdal_translate in.tif mask.tif -b mask > > That should work with images with nodata or alpha channel. > > > I guess that it would work but it feels a bit complicated. Is there any > > more direct way for doing this task with GDAL? > > None that I can think of. > > gdal_polygonize.py would possibly do a bit more work than really needed in > case there are holes of nodata inside the raster and you're not interested > in > such holes. > > -- > Spatialys - Geospatial professional services > http://www.spatialys.com > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > -- *The right coordinate system can turn an impossible problem into two really hard problems. -- Charlie Pellerin* Thomas Juntunen GIS Specialist Polar Geospatial Center R280 Learning and Environmental Science 1954 Buford Ave University of Minnesota St. Paul, MN 55108 612-626-0505
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
