gdal
gdal copied to clipboard
gdallocationinfo: extra line is output if coordinate is outside raster extent (3.9.0 regression)
What is the bug?
Running gdallocationinfo on a list of WGS84 coordinates which contains a value outside raster extent output an extra line. With previous versions, no extra line is added and no info is returned for this out-of-extent coordinate
Steps to reproduce the issue
The test.tif image contains Int16 values. This command outputs an extra line:
echo "4.048333333 46.021111110999996
4.0600000000000005 46" | gdallocationinfo -b 1 -valonly -geoloc test.tif | nl -b a
# 1 0
# 2
# 3
This one, with GDAL 3.3.2 does not:
echo "4.048333333 46.021111110999996
4.0600000000000005 46" | /Applications/QGIS.app/Contents/MacOS/bin/gdallocationinfo -b 1 -valonly -geoloc test.tif | nl -b a
# 1 0
# 2
Versions and provenance
Macos Sonoma 14.5 Brew GDAL 3.9.0, released 2024/05/07
Additional context
I tried several combinations of gdallocationinfo options like -ignore_extra_input or -field_sep and -E echo mode with always the same result