[postgis-users] How to change srid

51 views
Skip to first unread message

Marko Čubranić

unread,
Mar 30, 2010, 2:53:43 AM3/30/10
to postgi...@postgis.refractions.net
dear,

iv loaded data to postgis and for all geometry srid  is -1.
if i want to change srid without doing and transformations, can i do that and how?

Thank you,

Marko Cubranic

Marco Lechner - FOSSGIS e.V.

unread,
Mar 30, 2010, 2:59:42 AM3/30/10
to postgi...@postgis.refractions.net
change the SRID in the geometry_columns table. There should be a corresponding recordset defining the SRID, geometry type, geometry column and so on of your table.

Marco
_______________________________________________ postgis-users mailing list postgi...@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users

Marko Čubranić

unread,
Mar 30, 2010, 3:04:32 AM3/30/10
to PostGIS Users Discussion
i did that, but than i have problems with mapserver which reads two srid (original one and the one that i set) and doesnt want to visualize any geometry.

2010/3/30 Marco Lechner - FOSSGIS e.V. <marco....@fossgis.de>

Nicolas Gillet - MARKET-IP

unread,
Mar 30, 2010, 3:05:00 AM3/30/10
to PostGIS Users Discussion

Hello,

 

Editing the geometry_column table is half part of the job.

 

You have to update the geometries too.

 

UPDATE table SET the_geom  = ST_SetSRID(the_geom, 4326).

 

Usually the SRID is -1 when you forget to set the srid when you import a shape file.

 

Hope this helps.

 

Nicolas.

 

De : postgis-us...@postgis.refractions.net [mailto:postgis-us...@postgis.refractions.net] De la part de Marco Lechner - FOSSGIS e.V.
Envoyé : mardi 30 mars 2010 9:00
À : postgi...@postgis.refractions.net
Objet : Re: [postgis-users] How to change srid

Marko Čubranić

unread,
Mar 30, 2010, 3:06:27 AM3/30/10
to PostGIS Users Discussion
thank you,

i think this will help me.

Marko

2010/3/30 Nicolas Gillet - MARKET-IP <nicolas...@market-ip.com>

Hello,

 

Editing the geometry_column table is half part of the job.

 

You have to update the geometries too.

 

UPDATE table SET the_geom  = ST_SetSRID(the_geom, 4326).

 

Usually the SRID is -1 when you forget to set the srid when you import a shape file.

 

Hope this helps.

 

Nicolas.

 

De : postgis-us...@postgis.refractions.net [mailto:postgis-us...@postgis.refractions.net] De la part de Marco Lechner - FOSSGIS e.V.
Envoyé : mardi 30 mars 2010 9:00
À : postgi...@postgis.refractions.net
Objet : Re: [postgis-users] How to change srid

 

change the SRID in the geometry_columns table. There should be a corresponding recordset defining the SRID, geometry type, geometry column and so on of your table.

Fred Lehodey

unread,
Mar 30, 2010, 6:31:16 AM3/30/10
to PostGIS Users Discussion

Yves Moisan

unread,
Mar 30, 2010, 8:22:38 AM3/30/10
to PostGIS Users Discussion
Le 2010-03-30 03:04, Marko Čubranić a écrit :
> i did that, but than i have problems with mapserver which reads two
> srid (original one and the one that i set) and doesnt want to
> visualize any geometry.
Did you modify the constraint on your geometry ?

Yves

Reply all
Reply to author
Forward
0 new messages