[gdal-dev] ogr2ogr creates empty shape files

Eli Adam eadam at co.lincoln.or.us
Thu Mar 1 13:30:08 EST 2012


Wolfgang,

> how would one prevent OGR2OGR from creating an empty target files
> when a WHERE condition returns no records from the source files? This

I know that there is a COUNT() that can be used in the SELECT part.
I've never tried it in the WHERE part.  You might be able to try that.

> question came up during a batch process where dozens or even hundreds of files
> are converted and further processed. Is there an option besides of
> manually deleting those files?

Depending on how you are doing your batch process, you can use ogrinfo
with COUNT() as a test to decide if you should do the ogr2ogr part.

HTH, Eli

> TIA
>
> wolfgang
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list