I am trying to intersect two shape files, one is a vector of .5 x.5 degree rectangles, the other is a vector of 20 x 10 degree rectangles.

I want the ID values of the 20 x 10 degree polygons to be carried over to the .5 x .5 degree polygons which are contained within the larger shapes.

The intersection produces what looks like the product I want for the whole globe, however when saving this I get the following error:

Feature creation error (OGR error: Attempt to write non-polygon (LINESTRING) geometry to POLYGON type shapefile.)

AND half of the output is successfully saved, but not the remainder (see image).

Output of intersection

  • 2
    Save it to some more flexible format like GML then and see how the problematic intersections look like.
    – user30184
    Jan 25, 2017 at 20:32
  • how did you do this intersection, is it the "join attributes by location"? If so, which of the "geometric predicate" settings did you use? As an aside, it's interesting that it fell over at or around null island...
    – Steven Kay
    Jan 25, 2017 at 23:22
  • @user30184 Your answer gave me the result I was after, if you want to post it I will mark it as the chosen answer.
    – Amroco
    Jan 25, 2017 at 23:29
  • @Steven Kay, I used Vector > Geoprocessing > Intersect. Also odd that the intersection produced a point at the origin, and a vertical and a horizontal line going through this point.
    – Amroco
    Jan 25, 2017 at 23:31

1 Answer 1


Saving as a .gml produced a shapefile, line and point (at the origin).
The shapefile was what I was after.

Interestingly my colleague did not have this 'shut down halfway through' problem, and she has a more powerful computer, is using 2.18.3, compared to my 2.18.2.

Does not seem like a satidfactory explanation to this problem to me, BUT

While I am still not sure of the cause, saving a .gml worked as a solution.

  • 1
    maybe explained by this answer.. that's related to clipping, but could be a similar cause. glad to hear you got it to work!
    – Steven Kay
    Jan 25, 2017 at 23:48
  • I think you're right, but that's way above my head ;). I am glad I have got this solution.
    – Amroco
    Jan 25, 2017 at 23:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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