From 106358953bb3ac02a1440c84d527a415a0592c2d Mon Sep 17 00:00:00 2001 From: John Truckenbrodt Date: Wed, 3 Jul 2024 15:25:10 +0200 Subject: [PATCH] [feature2vector] fixed bug in cloning features --- spatialist/vector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spatialist/vector.py b/spatialist/vector.py index e3f37ae..3077c2e 100644 --- a/spatialist/vector.py +++ b/spatialist/vector.py @@ -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