gdal icon indicating copy to clipboard operation
gdal copied to clipboard

gdal vector pipeline: warn if no features were written

Open dbaston opened this issue 4 months ago • 3 comments

Feature description

If the GML driver is not available, the following command happily writes an empty file with no warning:

gdal vector pipeline \
            ! read WFS:"https://data.geopf.fr/wfs/ows?version=2.0.0&typename=ADMINEXPRESS-COG.2017:commune" \
            ! filter --where "insee_com='90065'" \
            ! write --output-layer=commune commune.fgb

Additional context

No response

dbaston avatar Jul 28 '25 11:07 dbaston

Was it totally empty, or with a schema but without any features? The latter case would be similar to the result from

ogr2ogr empty.fgb input.gpkg -sql "select * from input where 1=2"

jratike80 avatar Jul 28 '25 12:07 jratike80

Yes, I get a schema with no features.

dbaston avatar Jul 28 '25 12:07 dbaston

I'm wondering if we should warn. There are probably use cases where an empty layer is expected. (and I'm aware of some GDAL (API) users fail on GDAL warnings, although I wouldn't recommend doing that)

rouault avatar Jul 28 '25 13:07 rouault