1gdallocationinfo(1) General Commands Manual gdallocationinfo(1)
2
3
4
6 gdallocationinfo - raster query tool
7
9 Usage: gdallocationinfo [--help-general] [-xml] [-lifonly] [-valonly]
10 [-b band]* [-overview overview_level]
11 [-l_srs srs_def] [-geoloc] [-wgs84]
12 [-oo NAME=VALUE]* srcfile [x y]
13
15 The gdallocationinfo utility provide a mechanism to query information
16 about a pixel given its location in one of a variety of coordinate
17 systems. Several reporting options are provided.
18
19 -xml:
20 The output report will be XML formatted for convenient post
21 processing.
22
23 -lifonly:
24 The only output is filenames production from the LocationInfo
25 request against the database (i.e. for identifying impacted file
26 from VRT).
27
28 -valonly:
29 The only output is the pixel values of the selected pixel on each
30 of the selected bands.
31
32 -b band:
33 Selects a band to query. Multiple bands can be listed. By default
34 all bands are queried.
35
36 -overview overview_level:
37 Query the (overview_level)th overview (overview_level=1 is the 1st
38 overview), instead of the base band. Note that the x,y location (if
39 the coordinate system is pixel/line) must still be given with
40 respect to the base band.
41
42 -l_srs srs def:
43 The coordinate system of the input x, y location.
44
45 -geoloc:
46 Indicates input x,y points are in the georeferencing system of the
47 image.
48
49 -wgs84:
50 Indicates input x,y points are WGS84 long, lat.
51
52 -oo NAME=VALUE:
53 (starting with GDAL 2.0) Dataset open option (format specific)
54
55 srcfile:
56 The source GDAL raster datasource name.
57
58 x: X location of target pixel. By default the coordinate system is
59 pixel/line unless -l_srs, -wgs84 or -geoloc supplied.
60
61 y: Y location of target pixel. By default the coordinate system is
62 pixel/line unless -l_srs, -wgs84 or -geoloc supplied.
63
64 This utility is intended to provide a variety of information about a
65 pixel. Currently it reports three things:
66
67 · The location of the pixel in pixel/line space.
68 · The result of a LocationInfo metadata query against the datasource -
69 currently this is only implemented for VRT files which will report
70 the file(s) used to satisfy requests for that pixel.
71 · The raster pixel value of that pixel for all or a subset of the
72 bands.
73 · The unscaled pixel value if a Scale and/or Offset apply to the band.
74 The pixel selected is requested by x/y coordinate on the command line,
75 or read from stdin. More than one coordinate pair can be supplied when
76 reading coordinates from stdin. By default pixel/line coordinates are
77 expected. However with use of the -geoloc, -wgs84, or -l_srs switches
78 it is possible to specify the location in other coordinate systems.
79 The default report is in a human readable text format. It is possible
80 to instead request xml output with the -xml switch.
81 For scripting purposes, the -valonly and -lifonly switches are provided
82 to restrict output to the actual pixel values, or the LocationInfo
83 files identified for the pixel.
84 It is anticipated that additional reporting capabilities will be added
85 to gdallocationinfo in the future.
87 Simple example reporting on pixel (256,256) on the file utm.tif.
88 $ gdallocationinfo utm.tif 256 256
89 Report:
90 Location: (256P,256L)
91 Band 1:
92 Value: 115
93 Query a VRT file providing the location in WGS84, and getting the
94 result in xml.
95 $ gdallocationinfo -xml -wgs84 utm.vrt -117.5 33.75
96 <Report pixel="217" line="282">
97 <BandReport band="1">
98 <LocationInfo>
99 <File>utm.tif</File>
100 </LocationInfo>
101 <Value>16</Value>
102 </BandReport>
103 </Report>
105 Frank Warmerdam warmerdam@pobox.com
106
107
108
109GDAL Thu Jul 25 2019 gdallocationinfo(1)