Geoscience Reference
In-Depth Information
x
X location of target pixel. By default the coordinate system is pixel/line unless
-l_srs, -wgs84 or -geoloc supplied.
y
Y location of target pixel. By default the coordinate system is pixel/line unless
-l_srs, -wgs84 or -geoloc supplied.
The output of a simple pixel value query at geolocation (x=272755, y=3290298)
i s in the following format:
Report:
Location: (392P,245L)
Band 1:
Value: 1
If the option -xml is set, the format is changed to XML:
<Report pixel="392" line="245">
<BandReport band="1">
<Value>1</Value>
</BandReport>
</Report>
To obtain a more human readable format such as a comma or space separated
value file, the -valonly might be better suited. As an example, the following code
snippet queries multiple images, potentially in different projection systems. For each
GeoTIFF image (with extension .tif) in the current directory, the filename is printed,
followed by the pixel value in band 1 of the corresponding image at location defined
by coordinate (272755, 3290298) in the coordinate system NAD83/UTM zone 15N.
for file in *.tif; do
echo -n "$file "
gdallocationinfo -b 1 -valonly -l_srs espg:26915 $file 272755
3290298
done
image1.tif 539
image2.tif 520
image3.tif 540
image4.tif 451
...
Suppose we have a list of location values in a text file ( locations.txt ) with
two columns 'X','Y'
 
Search WWH ::




Custom Search