When I try to find the intersection of a line gdb layer with a polygon layer I get the following error: Can only insert a LineString/MultiLineString/CircularString/CompoundCurve/MultiCurve in a esriGeometryLine layer')

It works fine for point or polygon layers.

Here is my code:

for cliplayer in aoi_ds: driver = ogr.GetDriverByName('OpenFileGDB').CreateDataSource(outgdb)

  outlayer = driver2.CreateLayer(inlayer.GetName(), inlayer.GetSpatialRef(), inlayer.GetGeomType())
  for x in range(defn.GetFieldCount()):
  ogr.Layer.Clip(inLayer, inClipLayer, outLayer)  

How can I filter out the points being created in the clip command?

  • Maybe some polygon only touches some linestring, which yields a point as an intersection. Try to filter the intersection geometries by a geometry type for removing points.
    – user30184
    Aug 4 at 17:46
  • How would I do that before it is written out. Is there a way to do that with ogr. Aug 4 at 18:21
  • I have figured out that this is the problem, not sure how to fix it. Aug 4 at 19:04


Your Answer

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

Browse other questions tagged or ask your own question.