Skip to content

Commit

Permalink
[feature2vector] fixed bug in cloning features
Browse files Browse the repository at this point in the history
  • Loading branch information
johntruckenbrodt committed Jul 3, 2024
1 parent 92b850b commit 1063589
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spatialist/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,9 @@ def feature2vector(feature, ref, layername=None):
fields = [feat_def.GetFieldDefn(x) for x in range(0, feat_def.GetFieldCount())]
vec.layer.CreateFields(fields)
for feat in features:
vec.layer.CreateFeature(feat)
feat2 = ogr.Feature(vec.layer.GetLayerDefn())
feat2.SetFrom(feat)
vec.layer.CreateFeature(feat2)
vec.init_features()
return vec

Expand Down

0 comments on commit 1063589

Please sign in to comment.