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

Johan V aragorn_jv at yahoo.com
Fri Jul 14 02:46:02 PDT 2006


Hello,

I'm having some problems with a table 'reflijst' I created recently in
a Postgresql 7.3.4 - Postgis 0.8.2 - geos 1.0 database. If is a table
with SRID equals 103300 and geometrytype MULTIPOLYGON. I added the
the_geom field with the sql:

select AddGeometryColumn('public','reflijst','the_geom','103300','MULTIPOLYGON',2);

==> Which created the neccessary column and corresponding rule in the
geometry_columns table:

(COLUMN HEADERS) oid f_table_catalog f_table_schema f_table_name
f_geometry_column coord_dimension srid "type" attrelid varattnum stats

(ADDED CONTENT)
"13636488";"''";"public";"reflijst";"the_geom";"2";"103300";"MULTIPOLYGON";"13577009";"17";""

==> And the correct CHECK CONTRAINTS ARE CREATED FOR THAT TABLE
CONSTRAINT "$1" CHECK ((srid(the_geom) = 103300))
CONSTRAINT "$2" CHECK (((geometrytype(the_geom) = 'POINT'::text) OR
(the_geom IS NULL)))

Now am i trying to do the next sql statement on this table:

SELECT the_geom FROM reflijst WHERE ((the_geom && 'POLYGON
((33595.443392445566 15067.465440617714,281187.7093687274
15067.465440617714,281187.7093687274
254932.5345593823,33595.443392445566
254932.5345593823,33595.443392445566 15067.465440617714))'))

Than I get the response: ERROR:  Operation on two GEOMETRIES with
different SRIDs.

If I change 'POLYGON((...))' into 'SRID=103300;POLYGON((..))' in the
sql statement than I get a correct response, it is the expected
columns.
Or if I do not change the sql statement, but change the srid in the
table to -1 (i.e. UNKNOWN) and I change of course also the CHECK
CONSTRAINTS and the corresponding srid column in the geometry_columns
table, I also get a correct response.

What am I doing wrong? What do I have to change in the table or the
database that this still works! Because everthing in the table looks
correct. I can even view the data in the table with the products JUMP
and Quantum GIS. And I can execute the same sql statement on another
table without any problems (it is a table with point geometry).

Greetz,
Johan.



More information about the postgis-users mailing list