0

I created an empty database in PostGIS and I need to change the coordinate system from EPSG:4326 to EPSG:32632. I am confused if I should be transforming, altering or updating? Also, how do I know that it has changed it? The database is currently empty.

1
  • @hgb - if you could make this an answer it can be upvoted.
    – Ian Turton
    Commented Apr 11, 2022 at 7:23

2 Answers 2

1

Coordinate reference systems are defined for each column that contains geometry or geography data types. If your database is truly empty with no tables and therefore no columns, then you haven't defined anything yet as EPSG:4326 so you have nothing to change. When you add a table, you can define it to include a geometry column as, for example, geom geometry(POINT, 32632), if you intend to store points using WGS 84 / UTM zone 32N coordinates. See PostGIS Reference, Spatial Tables.

If you do need to change the coordinate system for a column after it is added, see Transforming geometry PostGIS column with unknown geometry type?

0

Databases do not have coordinate reference systems. Geometries do. When you actually load your data, make sure you're correctly specifying the coordinate reference system of the data you are loading. (Using the -s flag for shp2pgsql for example.)

If the data are correctly loaded, then the ST_Transform() function can be used to convert it to any other reference system you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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