I need to add point coordinates into table (
"xcoor" field and
"ycoor" field). I knew this could be done using the Field Calculator.
First I created a new field
"xcoor" and used expression
$x to get x coordinate. I set field type as decimal number (real). I did the same for the
The table looked like this:
For existing point
"ycoor" field were updated.
But when I tried to insert new point feature I didn't get it's coordinates in the table. Both fields were empty for that feature.
Then I changed field type like this creating new field but virtual with type double:
And now, when I add new point it's coordinates are automatically inserted into table. But I can't understand why is this possible using virtual field and why double data type is offered just in this case? I hope someone can explain this to me.