Skip to content

Commit

Permalink
Merge pull request #48 from johntruckenbrodt/bugfix/vector_clone
Browse files Browse the repository at this point in the history
[feature2vector] fixed bug in cloning features
  • Loading branch information
johntruckenbrodt authored Jul 3, 2024
2 parents 379d3f9 + 0496862 commit d7f00d3
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 d7f00d3

Please sign in to comment.