AnswerBun.com

Converting geometry of elements of table to move it from one srid system to another

Geographic Information Systems Asked on January 6, 2022

I have a table containing a column geom loaded from a shape file which was defined in lambert II system (27582), but when I loaded it I specified that I want to work in lambert 93 (2154).

Unfortunately when I load it in QGIS the coordinates are always in lambert II.

Is there a function allowing me to convert these coordinates and make them pass from lambert II (27582) to lambert 93 (2154)?

I would like to work only in lambert 93.

2 Answers

Go back and repeat the load using EPSG:27582 or use ST_SetSRID to set the correct CRS - then use the ST_Transform function to convert them to be in EPSG:2154 if that is what you require.

UPDATE table SET geom = ST_Transform(ST_SetSRID(geom, 27582), 2154);

Though QGIS is quite capable of reprojecting on the fly for you once the correct SRID is set using just:

UPDATE table SET geom = ST_SetSRID(geom, 27582);

Answered by Ian Turton on January 6, 2022

If your question is regarding PostGIS functions:

the ST_Transform function is what you are looking for. Something like this should do the trick:

UPDATE table
SET geom = ST_Transform(geom, 2154)

On the other hand, if your question is refering to a QGIS operation. You can change the SRID of your layer or the whole project from its properties.

Answered by ramiroaznar on January 6, 2022

Add your own answers!

Related Questions

Use Esri Portal Sign-in page for ASP.NET?

0  Asked on April 17, 2021 by ejobrien

     

ogr2ogr doesn’t find PostgreSQL driver

0  Asked on April 17, 2021 by slambeth

   

GDAL: wrong corner coordinates from KNMI grib file

0  Asked on April 17, 2021 by carpenter

     

Highlighting feature by Id with Leaflet

1  Asked on April 17, 2021

 

Buffer coastlines

1  Asked on April 16, 2021 by jepsonnomad

       

Convert large stars object to sf object

1  Asked on April 16, 2021 by pablo-herreros-cantis

       

QGIS crashes loading raster layer (.tif) through GDAL provider

0  Asked on April 16, 2021 by skew_t_pie

       

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir