[postgis-users] ERROR: Operation on two GEOMETRIES withdifferentSRIDs

Johan V aragorn_jv at yahoo.com
Fri Jul 14 06:30:58 PDT 2006


Hi Mark,

Here are the descriptions of the tables (in the same database running
POSTGIS 0.8.2):

[database_x]=# \d reflijst
          Table "public.reflijst"
  Column   |       Type        | Modifiers
-----------+-------------------+-----------
 artid     | integer           |
 titre     | text              |
 annee     | integer           |
 volume    | character varying |
 firstpage | character varying |
 auteurs   | text              |
 publica   | text              |
 strat     | character varying |
 domg_ol   | character varying |
 xlambert  | bigint            |
 ylambert  | bigint            |
 numcarte  | integer           |
 the_geom  | geometry          |
Check constraints: "$1" (srid(the_geom) = 103300)
                   "$2" ((geometrytype(the_geom) =
'MULTIPOLYGON'::text) OR (the_geom IS NULL))


[database_x]=# \d gnosbgm
             Table "public.gnosbgm"
   Column   |          Type          | Modifiers
------------+------------------------+-----------
 id         | numeric(28,6)          |
 gemeente   | character varying(254) |
 x          | numeric(28,6)          |
 y          | numeric(28,6)          |
 z          | numeric(28,6)          |
 kaart      | character varying(254) |
 logdiepte  | numeric(28,6)          |
 diepte     | numeric(28,6)          |
 bgdnr      | character varying(254) |
 bgdcode    | character varying(254) |
 refer      | character varying(254) |
 hotlink    | character varying(254) |
 imagepath1 | character varying(254) |
 logcomp    | character varying(254) |
 date       | character varying(10)  |
 tert_plio  | character varying(1)   |
 tert_mio   | character varying(1)   |
 tert_paleo | character varying(1)   |
 tert_eoc   | character varying(1)   |
 tert_oligo | character varying(1)   |
 primair    | character varying(1)   |
 secundair  | character varying(1)   |
 tertiair   | character varying(1)   |
 quartair   | character varying(1)   |
 the_geom   | geometry               |
Indexes: sidx_gnosbgm gist (the_geom)
Check constraints: "$1" (srid(the_geom) = 103300)
                   "$2" ((geometrytype(the_geom) = 'POINT'::text) OR
(the_geom IS NULL))

And the two sql statements:

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

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))'))

They are just the same, only the first give me the required answer!

Grz,
Johan

2006/7/14, Mark Cave-Ayland <m.cave-ayland at webbased.co.uk>:
>
> > -----Original Message-----
> > From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> > bounces at postgis.refractions.net] On Behalf Of Johan V
> > Sent: 14 July 2006 12:46
> > To: postgis-users at postgis.refractions.net
> > Subject: Re: [postgis-users] ERROR: Operation on two GEOMETRIES
> > withdifferentSRIDs
> >
> > Hi Mark and others,
> >
> > Yes the geometry created on the fly is -1, but this same sql statement
> > (with the on the fly created geometry) does work on another table with
> > SRID=103300, but not on this one.
> >
> > I need this specific sql statement because it is a statement that is
> > issued by a software product that makes a WFS/WMS service (GIS Service
> > over the internet) of this table.
> >
> > So do I have to change or check some thing in the table to be able to
> > use this kind of sql statement:
> >
> > SELECT the_geom FROM table_x WHERE ((the_geom && 'POLYGON((...))')).
> >
> > Greetz,
> > Johan.
>
>
> Hi Johan,
>
> Hmmm that makes it a bit more tricky. Unfortunately the SQL being issued is
> relying on the implicit cast in PostgreSQL rather than using
> GeomFromText()/setSRID() as documented and so its behaviour may change
> across PostgreSQL/PostGIS versions - if you do get a chance to update the
> SQL in your client software, I would highly recommend it.
>
> As for the symptoms you are seeing, I am slightly baffled - can you post the
> output of \d <table> for one of your tables that works and your new one that
> doesn't, the exact SELECT queries being executed on each table, and can you
> confirm that both tables are in the same database running the same version
> of PostGIS?
>
>
> Kind regards,
>
> Mark.
>
> ------------------------
> WebBased Ltd
> 17 Research Way
> Plymouth
> PL6 8BT
>
> T: +44 (0)1752 797131
> F: +44 (0)1752 791023
>
> http://www.webbased.co.uk
> http://www.infomapper.com
> http://www.swtc.co.uk
>
> This email and any attachments are confidential to the intended recipient
> and may also be privileged. If you are not the intended recipient please
> delete it from your system and notify the sender. You should not copy it or
> use it for any purpose nor disclose or distribute its contents to any other
> person.
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list