[postgis-users] Questions about using SRID not -1

Kevin Neufeld kneufeld at refractions.net
Fri Jan 22 08:28:09 PST 2010


On 1/21/2010 12:14 PM, Oscar Zamudio wrote:
> I already tried this way:
>
> UPDATE mypoints SET the_geom = ST_SetSRID(the_geom,4326);
>
> But I got:
>
> ERROR:  Operation on two GEOMETRIES with different SRIDs
>

This doesn't make sense to me.  ST_SetSRID simply updates the internal structure of the geometry.  It's not doing any 
operation on the geometry.  Do you maybe have a TRIGGER and/or RULE on the table that is invoking another function on an 
UPDATE operation?

Try this:
CREATE TABLE mypoints2 AS SELECT the_geom FROM mypoints;
UPDATE mypoints2 SET the_geom = ST_SetSRID(the_geom,4326);

If that doesn't work, can you please isolate an example?  On what geometry exactly is the ERROR thrown?

-- Kevin



More information about the postgis-users mailing list