5

I have a shapefile in which some of the features have NULL geometries. What I would like to do is to copy existing geometries from other features and paste them to those features within the same layer that have a NULL geometry.

Is there an easy way to do this within QGIS, preferably the GUI?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
guyus
  • 141
  • 7

2 Answers2

6

Not sure if there's a direct and easy method to do this but what I would probably do is:

  1. Edit your layer by toggling the Edit icon:

    Toggle editing


  1. Duplicate your geometry feature (Copy/Paste):

    Copy/paste


  1. Select one of the geometry feautures (these will be overlapping so easier to select from the Attribute Table) and the NULL feature you want joined.

  1. Merge the attributes of the two features by using the Merge Attributes of Selected Features tool and choose the attribute from the NULL feature:

    Merge attributes of selected features

    Merging attributes from NULL feature


  1. You can then delete the original NULL features if you wish. Don't forget to save the edits!
Joseph
  • 75,746
  • 7
  • 171
  • 282
  • 1
    Great! This works very well. Thanks for the detailed instructions! – guyus Sep 20 '16 at 15:30
  • @guyus - Most welcome, glad it works :) – Joseph Sep 21 '16 at 09:37
  • As of QGIS 2.2 the Merge Attributes of Selected Features button moved to the Advanced Digitizing Toolbar and looks different. – aae Jun 14 '17 at 09:46
  • @WilliamBligh - Hmm there's two buttons. The icon to the left of what I highlighted in the red circle (and what is shown in the link you provided) is the Merge Selected Features button. The one inside the red circle is the Merge Attributes of Selected Features button :) – Joseph Jun 14 '17 at 09:54
4

There is a plugin which allows you to copy just the geometry between features:

https://plugins.qgis.org/plugins/geometry_copier/

enter image description here

Thomas B
  • 8,807
  • 1
  • 21
  • 62