<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Using GDAL and QGIS, I am able to pan and zoom through 1699 highly compressed GeoJP2 images,&nbsp;that are seamlessly joined together by a .vrt file.&nbsp;After zooming in to narrowing the area of interest, I then want to know the filename of the highly compressed GeoJP2 image I am currently viewing, so that I can then pull up for that area, a reversible compressed GeoJP2 or a GeoTIFF.</div><div><div>Do be able to accomplish this, I wrote</div><div>1. gdalinfo_11.sh</div><div>a 25 line bash shell script that extracts from gdalinfo, and writes to a text file, the GeoJP2/GeoTIFF filename, and the Upper Left and Lower Right x,y coordinates</div><div>2.&nbsp;xy2file_28.c</div><div>a 110 line C program that reads in from the text file created by gdalinfo_11.sh, and the current x,y coordinates displayed by QGIS, and then&nbsp;writes out the filename of the 1 of 1699 georeferenced images that contains those coordinates.&nbsp;Below is a sample output. I note that running xy2file_28 takes only 0.01 seconds.</div><div><div><font class="Apple-style-span" face="Courier">&nbsp;/usr/bin/time ./xy2file_28 ${HOME}/gis/text_for_dcua/xy_coor_11.txt 294898 4313543</font></div><div><font class="Apple-style-span" face="Courier">&nbsp;inx=294898.000000 iny=4313543.000000&nbsp;</font></div><div><font class="Apple-style-span" face="Courier">&nbsp;Checking 0 100 200 300 &nbsp;</font></div><div><font class="Apple-style-span" face="Courier">&nbsp;inx= &nbsp;294898.0000 iny= 4313543.0000 is within&nbsp;</font></div><div><font class="Apple-style-span" face="Courier">&nbsp;ulx= &nbsp;294000.0000 lrx= &nbsp;295500.0000 uly= 4314000.0000 lry= 4312500.0000 of&nbsp;</font></div><div><font class="Apple-style-span" face="Courier">&nbsp;18stj940125.jp2&nbsp;</font></div><div><font class="Apple-style-span" face="Courier">&nbsp;Resuming checking 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1699&nbsp;</font></div><div><font class="Apple-style-span" face="Courier">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;0.01 real &nbsp; &nbsp; &nbsp; &nbsp; 0.00 user &nbsp; &nbsp; &nbsp; &nbsp; 0.00 sys</font></div></div><div><br></div><div>This script and this program can be downloaded from&nbsp;<a href="http://homepage.mac.com/gregcoats/jp2/xy2file.zip">http://homepage.mac.com/gregcoats/jp2/xy2file.zip</a></div><div>While these meet my current requirement, they need to be revised and improved to address the wider GDAL audience. I am not qualified to do that, but perhaps someone will more programming and GDAL experience than me will consider doing so.</div><div>Greg</div></div></body></html>