<div dir="ltr"><div>To get the result using command line, I found the 3 commands did the trick. <br></div><br><div><span class="gmail-il">gdal_translate</span> -b mask -of vrt -a_nodata 0 'path/to/input.tif' test.vrt</div><div><span class="gmail-il">gdal_translate</span> -b 1 -of vrt -a_nodata 0 test.vrt test2.vrt</div><div>gdal_polygonize.[bat/py] -q  -8 test2.vrt -b 1 -f "ESRI Shapefile" testdata.shp<br><br></div><div>This was off Stack exchange somewhere.<br><br></div><div>However, I'd like to get this same geometry in python. <br><br></div><div>I keep hitting roadblocks as I'm not real sure how to use <br>gdal.Translate or gdal.TranslateOptions<br><br></div><div>ive tried<br></div><div>gtp = gdal.TranslateOptions(format="vrt",bandList="mask", noData=0)<br></div><div>in attempt to start with the first gdal_translate command. <br><br></div><div>I'm also curious if there's another way, perhaps using --oo or something different. <br><br></div><div>In the end I'd ultimately like to get a geometry poly object of where the actual imagery data is in the file. <br><br></div><div>Any pointers?<br></div></div>