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

ogr2ogr: catch invalid -spat arguments better #9623

Closed
jidanni opened this issue Apr 4, 2024 · 1 comment · Fixed by #9645
Closed

ogr2ogr: catch invalid -spat arguments better #9623

jidanni opened this issue Apr 4, 2024 · 1 comment · Fixed by #9645
Assignees

Comments

@jidanni
Copy link
Contributor

jidanni commented Apr 4, 2024

Feature description

ogr2ogr -spat BLA 30 -90 50 orr.csv -dialect SQLITE -sql \
'SELECT XCOORD,YCOORD,POINTID FROM PLSSPoint_GCDB WHERE
POINTID LIKE "UT260060S0020E0%"' file.gdb.zip; echo $?
ERROR 1: Invalid geometry field index : 0
0

Maybe say

ERROR 1: Invalid geometry field index : 0 (xmin)

or

ERROR 1: Invalid geometry field index : 0 ("BLA") (xmin)

Additional context

And more importantly, set $? to non-zero!

@rouault
Copy link
Member

rouault commented Apr 5, 2024

The issue about BLA being silently mis-parse has been fixed in master by the switch to the argparser module. There's now an error message.
The error message that was emitted (and didn't result in an error return code) was due to trying to apply a spatial filter to a layer that has no geometry field (as you only selected attribute fields). Fixed per #9645

rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 5, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 14, 2024
rouault added a commit to rouault/gdal that referenced this issue Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants