[postgis-users] Incorrect results from queries specifying an SRID

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Tue Jun 1 03:55:57 PDT 2004


Hi strk,

Yup you're right :) I didn't notice that we didn't use the old files any
more - I guess they're there while people test the new postgis.sql build
process?

So in theory this should be solved in the 0.8.2 release. cp, can you
test this for us by doing the following in psql, and seeing whether the
SRID mismatch is caught? Note this is done in a transaction as it
affects the system catalogs and so we can roll it back if it doesn't
work.


BEGIN;

UPDATE pg_amop SET amopreqcheck = 't' WHERE amopclaid=(SELECT oid FROM
pg_opclass WHERE opcname = 'gist_geometry_ops');

(this should update only 8 entries)

SELECT * FROM gis
WHERE geometry && GeometryFromText('BOX3D(325356 6341280,335614 
6328019)'::box3d, 26712);


If this throws an error on SRID mismatch then you can COMMIT the
transaction to make the behaviour permanent. Otherwise type ABORT and
the change will be rolled back. Please report back to as to whether this
solved the problem for you.


Many thanks,

Mark.

---

Mark Cave-Ayland
Webbased Ltd.
Tamar Science Park
Derriford
Plymouth
PL6 8BX
England

Tel: +44 (0)1752 764445
Fax: +44 (0)1752 764446


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.

> -----Original Message-----
> From: strk [mailto:strk at keybit.net] 
> Sent: 01 June 2004 11:38
> To: Mark Cave-Ayland
> Cc: 'PostGIS Users Discussion'
> Subject: Re: [postgis-users] Incorrect results from queries 
> specifying an SRID
> 
> 
> On Tue, Jun 01, 2004 at 11:09:42AM +0100, Mark Cave-Ayland wrote:
> > 
> > > -----Original Message-----
> > > From: postgis-users-bounces at postgis.refractions.net
> > > [mailto:postgis-users-bounces at postgis.refractions.net] On 
> > > Behalf Of Paul Ramsey
> > > Sent: 28 May 2004 21:10
> > > To: PostGIS Users Discussion
> > > Subject: Re: [postgis-users] Incorrect results from queries 
> > > specifying an SRID
> > > 
> > > 
> > > cp wrote:
> > > > My expectation
> > > > would be for postgis to automatically transform the
> > > coordinates to match
> > > > the SRID of the geometries stored in the table (4267) or at
> > > least to
> > > > give me an error.
> > > 
> > > You should be getting an error, that is the only 
> noticable bug. SRID
> > > mismatches are supposed to raise errors (to prevent precisely the 
> > > problem you demonstrate going quietly unnoticed).
> > 
> > Hmmm I think this is another symptom of not having RECHECK 
> specified 
> > in the operator class - I thought that strk committed this change 
> > after we brought up the discussion earlier this year? It looks like 
> > it's only specified for PostgreSQL 7.1 at the moment.
> > 
> > [looks through the source...] It's definitely not in 
> > postgis_7*_end.sql for >= 7.2. strk, did this get lost somewhere in 
> > your changes for rebuilding postgis.sql?
> 
> postgis_7*.sql are obsolete code.
> The new enabler script is postgis.sql.in
> It contains RECHECK clauses for PG73,74,75 in CREATE OPERATOR CLASS
> 
> --strk;
> 
> > 
> > 
> > Cheers,
> > 
> > Mark.
> > 
> > ---
> > 
> > Mark Cave-Ayland
> > Webbased Ltd.
> > Tamar Science Park
> > Derriford
> > Plymouth
> > PL6 8BX
> > England
> > 
> > Tel: +44 (0)1752 764445
> > Fax: +44 (0)1752 764446
> > 
> > 
> > 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