Skip to content

Commit

Permalink
Added some feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanbasten-ns committed Oct 31, 2023
1 parent cc86e18 commit 17f7ffd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions threedi_plugin_layer_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ def copy_layer_into_memory_layer(source_layer, layer_name, dest_layer):

dest_provider = dest_layer.dataProvider()

dest_provider.addAttributes(source_provider.fields())
if not dest_provider.addAttributes(source_provider.fields()):
logger.error(dest_provider.lastError())
dest_layer.updateFields()

dest_provider.addFeatures(source_provider.getFeatures())
if not dest_provider.addFeatures(source_provider.getFeatures()):
logger.error(dest_provider.lastError())
dest_layer.updateExtents()

if source_provider.featureCount() != dest_provider.featureCount():
messagebar_message("Error", "Not all features are loaded in layer {layer_name}!", level=2, duration=5)

return dest_layer


Expand Down

0 comments on commit 17f7ffd

Please sign in to comment.