views:

244

answers:

1

I have table where the one of columns is geometry column the_geom for polygons with SRID. I added new column in the same table with exactly the same geometry data as in the_geom. This another column has name the_geom4258 because I want here to set up another SRID=4258. So what is the procedure to set up another SRID geometry to be changed (in another coord.system)? Is just enough to apply following query:

UPDATE table SET the_geom4258=ST_SetSRID(the_geom4258,4258);

+1  A: 

You should use the ST_Transform function. Also use the function AddGeometryColumn to create your new column, to ensure all the necessary constraints are also created:

SELECT AddGeometryColumn('table','the_geom4258',4258, 'POLYGON', 2);

UPDATE table SET the_geom4258 = ST_Transform(the_geom,4258);

ST_SetSRID just sets the projection identifier, but does not actually transform the geometries.

amercader
Your answere is exactly what I need. So thank you very much indeed. There is just one small thing, now i got error:"ERROR: AddToPROJ4SRSCache: couldn't parse proj4 string: '+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.999900 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=ETRS89 +units=m +no_defs': unknown elliptical parameter name"Any clue what should I co correct now?
Z77
Make sure there is a record for srid 4258 in the spatial_ref_sys table of your database. If there is a record, check that the projection parameters match the ones in here:http://spatialreference.org/ref/epsg/4258/postgis/
amercader
OK! I am lucky girl, all answeres I can find here:)
Z77