I know that I can add a new column to a spatialite table either through the Database Manager (Edit Table – Add Column) or through the Attribute Table – Field Calculator (create new field) but I don´t know which settings to use there to get a new column populating itself with an autoincrementing primary key. I guess it must be possible...
I also have the Plugins Table Manager and QSpatialite installed.
I´m still a bit confused. Why should the newly created "Test_table2" have a geometry column after I create it with above code. The symbol is just the normal table symbol and the field list looks like this
If I then try the "Add Geometry" code above I do not see a "0" im the output but this:
After this step the symbol changes from table symbol to the points symbol in the browser tab but its still not a valid table with geometry. I cant see the two points from my original layer when I show this table as a layer.
If I try to "create the spatial index" by clicking next to the attention sign and confirm the following window with "Yes" (Do you want to create..." then something happens, the red sign disappears but still I can´t see my points in the map canvas.
If I try your other tipp and use the Recover Geometry though I get the following result and not even the symbol changes from the tables symbol into anything else:
I´d just like to understand whats going on here.
It´s probably got to do something with me being new at using code that I don´t recognize a mistake in dealing with this problem.