OGR option to force named driver only on read
|Reported by:||maphew||Owned by:||warmerdam|
It would be useful to have OGR use only the named drivers when attempting to read in input source. Basically the inverse of
The scenario where I want this right now: I'm troubleshooting why some files I have are not recognized or converted by ogr2ogr. Using OGR_SKIP environment variable to leave only 1 or 2 drivers enabled requires a command line string approaching 600 characters, and is easy to write incorrectly (quoted spaces etc.)
In an experiment using python
ogr.GetDriverByName(in_format) it comes to light that at least in one case the instruction is overridden by something else. When in_format is CSV and infile is 'thing.txt' it fails, while infile of 'thing.csv' succeeds. See http://gis.stackexchange.com/questions/141905/force-ogr-to-use-specific-driver-for-input-format
In this we also learned that as of gdal 1.8
CSV:thing.txt forces using the CSV driver. So somebody encountered the need often enough to program a workaround in the driver itself. This ticket is suggesting this logic be promoted out of single-case use and made available everywhere.
As to syntax, either
-in_format ARCGEN both look good to me. Though the latter might be useful for saying "try these drivers in this order".