I have a large line feature class (15GB) in a File Geodatabase that I would like to clip. I am trying to use ogr2ogr to do this, however I keep getting the error:

ERROR 1: Unable to write feature 11802 from layer inputLines.
ERROR 1: Terminating translation prematurely after failed
translation of layer inputLines (use -skipfailures to skip errors)

If I use –skipfailures, a lot of my lines are missing from the output.

The feature class itself seems ok.

  • The ArcToolbox's Check Geometery tool returns no errors with the input feature class.
  • I am also able to use ogr2ogr to copy the input feature class without any errors and have tried to use new feature class as input with the same result.

Here’s what I’m using when I try to output to another feature class.

ogr2ogr e:\output.gdb e:\input.gdb  inputLines -clipsrc clipPoly.gdb -nln outputFc -f "FileGDB"

Here’s what I use when I try to output to PostGIS

ogr2ogr PG:"dbname='mydb' host='localhost' port='5432' user='postgres' password='password'" e:\input.gdb  inputLines -clipsrc clipPoly.gdb -f "PostgreSQL"

The error is nearly identical except for the feature id number.

Last, I've also tried the ArcToolbox Clip tool, it just crashes after about 10 minutes.

  • Can you try adding -nlt PROMOTE_TO_MULTI to the ogr2ogr command? It could be failing because of a geometry mismatch.
    – SaultDon
    Mar 27, 2015 at 0:04
  • @SaultDon I haven't tried that but I believe that's what the problem is. I isolated one line feature where it was failing. When I changed the output to GeoJSON, I could see that it was taking the one line, and trying to create two lines and a point. Since you can't have multiple geometry types in a FileGDB is failed.
    – dvdhns
    Mar 30, 2015 at 19:58

1 Answer 1


What I had found was the line features that failed were zig-zagged between two different features in my clip feature. When I merged all my clip features together I no longer get the error and it clips as expected.

Not sure why having multiple features in my clip feature would cause this, but merging them together resolved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.