1. First, convert the SHP file into an SQL statement: (indicating the original projection of data)
Shp2pgsql-w gbk-s 4610-G _ GEO sample. SHP tb_sample> sample. SQL
2. Execute the SQL file generated in the previous step and import the data to the database:
Psql-D dbname-F sample. SQL-u Postgres
3. perform projection conversion:
-- Select * From geometry_columns; -- view the projection information recorded in the geometry_columns table.
Alter table tb_sample add column _ geo1 geometry; -- add a field to store the projected information.
Update tb_sample SET _ geo1 = st_transform (_ GEO, 900913); -- perform projection conversion and set the 4610 (original projection) of the input data to 90013 (target projection)
Update geometry_columns set SRID = 900913 where f_table_name = 'tb _ sample \ '; -- Update information in the system table
Alter table tb_sample drop column _ GEO; -- delete the original field
Alter table tb_sample rename _ geo1 to _ GEO; -- update the field name
Since then, projection has been completed, done ....