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.
2 Answers
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?
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.