Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdal2xyz.bat not accepting -b any band number #5984

Closed
SrNetoChan opened this issue Jun 24, 2022 · 0 comments
Closed

gdal2xyz.bat not accepting -b any band number #5984

SrNetoChan opened this issue Jun 24, 2022 · 0 comments
Assignees

Comments

@SrNetoChan
Copy link
Contributor

Expected behavior and actual behavior.

I am testing the GDAL tools on QGIS 3.22.8 on Windows. When running gdal2xyz with a single band raster I am getting the following error:

C:\Users\testing_user>gdal2xyz.bat -b 1 C:/Users/testing_user/Desktop/gdal_commands_test/mdt_clipped.tif OUTPUT.csv
usage: gdal2xyz.py [-h] [-skip] [-srcwin xoff yoff xsize ysize] [-b band [band ...]] [-allbands] [-csv] [-skipnodata]
[-srcnodata [SRC_NODATA ...]] [-dstnodata [DST_NODATA ...]]
src_dataset dst_dataset
gdal2xyz.py: error: argument -b/-band/--band: invalid int value: 'C:/Users/testing_user/Desktop/gdal_commands_test/mdt_clipped.tif'

If I remove the -b option it works.

Windows Is now on GDAL 3.5.0. On my linux machine that still uses GDAL 3.0.4 it works fine.

Steps to reproduce the problem.

gdal2xyz.bat -b 1 C:/Users/testing_user/Desktop/gdal_commands_test/mdt_clipped.tif OUTPUT.csv

Operating system

Windows 10

GDAL version and provenance

GDAL 3.5.0

@rouault rouault self-assigned this Jun 24, 2022
rouault added a commit that referenced this issue Jun 24, 2022
gdal2xyz.py: fix parsing of -b option (fixes #5984)
rouault added a commit that referenced this issue Jun 24, 2022
[Backport release/3.5] gdal2xyz.py: fix parsing of -b option (fixes #5984)
g8sqh pushed a commit to g8sqh/gdal that referenced this issue Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants