[postgis-users] ERROR: Operation on two GEOMETRIES with different SRIDs (again)

Nicklas Avén nicklas.aven at jordogskog.no
Mon Feb 14 06:58:19 PST 2011


Hallo

You have two problems here

first

You don't transform the geometr to another srid with set_srid, you just
tell what srid the geometry has.

use ST_Transform instead

second.

Do your transformation into a new table or at least into a new column to
don't get in trouble with srid-constraints.

But why you get that error message here I can't see at once. 

HTH

Nicklas

On Mon, 2011-02-14 at 08:58 -0500, Farrukh Najmi wrote:
> I have a table GeometryValueType with column of type geometry and name 
> geometry.
>  From advice received on a previous thread on this list I have made sure 
> that all data in geometry column has the same SRID.
> Currently them SRID is 4326 (EPSG:4326). I would now like to transform 
> all values ion the column to use (EPSG:4979) in order to support 3D data.
> 
> So I loaded the EPSG:4979 definition into spatial_ref_system using:
> 
> http://spatialreference.org/ref/epsg/4979 (Page for 4979 CRS)
> http://spatialreference.org/ref/epsg/4979/postgis/ (INSERT statement for 
> postgis)
> 
> I then tried the following statement to transform all data in the 
> geometry column to EPSG:4979 as follows:
> 
>    UPDATE GeometryValueType SET geometry = ST_SETSRID(geometry, 4979)
> 
> But this gave me the familiar:
> 
> ERROR:  Operation on two GEOMETRIES with different SRIDs
> 
> I have made sure that all data in the geometry column has srid of 4326 
> using:
> 
>    SELECT DISTINCT ST_SRID(geometry) FROM GeometryValueType;
> 
> So why am I getting the "ERROR:  Operation on two GEOMETRIES with 
> different SRIDs"?
> 
> Thanks for your help.
> 





More information about the postgis-users mailing list