Skip to content

Commit

Permalink
fix: feature ID not being set back to former ID
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaTschi committed Sep 16, 2024
1 parent 1362111 commit 931d3d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vector-extractor/NativeLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ void NativeLayer::save_modified_layer(std::string path) {

OGRErr error;

auto id_before = feature->GetFID();

// First try updating the feature, then create it if unsuccessful
error = out_layer->SetFeature(feature);

if (error > 0) {
error = out_layer->CreateFeature(feature);
}

feature->SetFID(id_before);

if (error > 0) std::cout << "Error saving feature: " << error << std::endl;
}

Expand Down

0 comments on commit 931d3d5

Please sign in to comment.