Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to modify the SRID of a spatial field in Postgresql
How to modify the SRID of a spatial field in Postgresql
Hello, I'm glad to answer your question.

Firstly, the SRID of the corresponding field in the geometry_columns table is modified to a new coordinate system ID;

Secondly, modify the definition of Beijing _ highway table and delete the definition of enforce _ dims _ the _ geom (ST _ srid (the _ geom) = (-1) (note: here _ geom is a spatial field);

Then update the data content: update table _ name set the _ geom = ST _ geomfromtext (ST _ astext (the _ geom), 4326) (note: 4326 here is the coordinate system ID); Data);

Finally, add the definition of enforce _ dims _ the _ geom (st _ SRID (the _ geom) = (4326)) to change the srid.

If you adjust from one coordinate system to another, you need to transform the coordinate system. At this point you may realize that fields can only be added, that is, inserted.

The Mercator projection is converted into 4326 by using postgis function and inserted into the spatial database.

Power = #? Insert? Become? Testing? Value (1,' hahaha', st _ transform (st _ geomfromtext ('point

( 10070507.650288? 428290 1.628 13 14)',9009 13),4326));

Insert? 0? 1

Power = #? Choice? Astext (location)? From where? Testing;

astext

-

Point (-104.987? 39.739)

Point (-104.955? 39.739)

Point (10? 10)

Point (100707? 428290 1.628 13 14)

Point (90.4649094 109628? 35.87 1 1 16252603 1)

(5? Ok)

Power country = # If you are satisfied, please click on the right to adopt the answer. If you have any questions, please click Ask.

I hope my answer is helpful to you, and I hope it will be adopted!

~? O(∩_∩)O~