[GIS] How to add a geometry to an existing feature that was created with NULL geometry

null-geometryqgisspatialite

I have a simple SpatiaLite geodb loaded in QGIS with one table. There is a POINT geometry field and some alphanumeric data. In some cases I can record data about a specific site, but the coordinates are not available at this time and will be retrieved and recorded later. In some other cases I have the coordinates and I want to insert them right into the geometry field, preferably by clicking on the map canvas in the same way available for adding new features (having a separate text field for the coordinates and generating the geometry from that is a no-go).

How do I add a geometry to an existing feature that was created with a NULL geometry field?

Best Answer

If you're after a GUI solution, you can use the "Add Part" tool (QGIS >=2.2 only). First, make your layer editable. Then in an Attribute Table select a single row with a null geometry that you want to add a geometry to. Back in the map canvas, select the "Add Part" tool and draw your geometry. The null geometry will be replaced by your newly drawn shape.

Related Question