Using GDAL and QGIS, I am able to pan and zoom through 1699 highly compressed GeoJP2 images, that are seamlessly joined together by a .vrt file. 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. Do be able to accomplish this, I wrote 1. gdalinfo_11.sh 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 2. xy2file_28.c 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 writes out the filename of the 1 of 1699 georeferenced images that contains those coordinates. Below is a sample output. I note that running xy2file_28 takes only 0.01 seconds. /usr/bin/time ./xy2file_28 ${HOME}/gis/text_for_dcua/xy_coor_11.txt 294898 4313543 inx=294898.000000 iny=4313543.000000 Checking 0 100 200 300 inx= 294898.0000 iny= 4313543.0000 is within ulx= 294000.0000 lrx= 295500.0000 uly= 4314000.0000 lry= 4312500.0000 of 18stj940125.jp2 Resuming checking 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1699 0.01 real 0.00 user 0.00 sys
This script and this program can be downloaded from http://homepage.mac.com/gregcoats/jp2/xy2file.zip 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. Greg
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev