-3

I've a point layer in ESPG 32632 spatial reference in my SpatiaLite database.

To add X and Y columns I've used Adding columns with x/y data to SpatiaLite Layer? and it works fine.

Now I need to add also Lat and Lon columns to store coordinates in EPSG4326.

Any example?

  • 3
    A good question should include your attempt and detail of what happens when you try it. What have you tried? Please edit your question to include this information. – Midavalo Apr 16 '17 at 15:20
2

The answer is basically the same here. Execute the following SQL expressions:

ALTER TABLE points ADD COLUMN LON double;
ALTER TABLE points ADD COLUMN LAT double;
UPDATE points SET LON=ST_X(ST_Transform(geometry,4326));
UPDATE points SET LAT=ST_Y(ST_Transform(geometry,4326));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.