[postgis-users] change to box3d()?

sgillies at frii.com sgillies at frii.com
Fri Sep 17 09:11:32 PDT 2004


Hi,

An application of mine has failed after an upgrade from postgis 0.8 to
0.8.2.  I've traced the problem to an apparent change in box3d.

The failed query was something like this (actual numerical values
are ommitted to save space), two clauses are marked *a and *b

  SELECT listing_id, the_geom
  FROM listing
*a  WHERE the_geom && box3d(transform('SRID=4269;POLYGON((...))', 26913))
  AND 1=1
*b  AND within(listing.the_geom, transform('SRID=4269;POLYGON((...))',
26913))

result:
  ERROR:  Operation on two GEOMETRIES with different SRIDs

It's the same polygon within the transforms.  Including a 'where bounding
box overlap' clause, as i understand it, is the way to a faster query.
This query worked well with postgis 0.8.

With 0.8.2, omitting clause *a yields the proper results, but slowly.
I discovered that dropping the box3d() call in clause *a and simply
comparing geometry bounds gave the quick result i wanted.

Was this call to box3d() superfluous?  Is my new query without box3d()
just as optimal as it was with box3d() under postgis 0.8?

cheers,
Sean






More information about the postgis-users mailing list