[postgis-devel] PATCH: New positional operators based on Y position of bounding boxes
Mark Cave-Ayland
m.cave-ayland at webbased.co.uk
Tue Jan 11 06:35:38 PST 2005
Hi strk,
> -----Original Message-----
> From: strk at refractions.net [mailto:strk at refractions.net]
> Sent: 11 January 2005 12:24
> To: Mark Cave-Ayland
> Cc: 'PostGIS Development Discussion'
> Subject: Re: [postgis-devel] PATCH: New positional operators
> based on Y position of bounding boxes
(cut)
> Your naming is good, and having dopped box2d operators I
> think Paul won't be against adding these *useful* ones.
Great. I've committed the changes to CVS.
> Then we should take a breath to plan release path.
OK. I did have a few things that I did notice from current CVS:
- There is still mention of PG 7.1 in the .sql.in files, even though
LWGEOM
is only supported for PG >= 7.2.
- I did not notice any SRID checking in the LWGEOM_* functions in
lwgeom_gist.c.
Hence the following works without throwing an error in CVS:
mca1=# select astext(the_geom) from t1 where setSRID(the_geom, -1)
|&>
setSRID('POINT(0 0)'::geometry, -2);
astext
------------
POINT(0 0)
POINT(0 1)
POINT(0 2)
(3 rows)
- It suddenly occurred to me that using the new operators, it may be
possible to
devise a binary search algorithm to determine the extents of a
column. For example,
using queries like:
SELECT 1 FROM my_geom_column WHERE my_geom_column >>
'POINT(A B)' LIMIT 2
where A and B are altered using a standard binary search, it should
be possible to
quickly find the right-most geometry in the column when a GiST index
is present by
looking at the number of records returned. If this is repeated for
the remaining 3
sides then we have a "quick" way of accurately determining the
overall extent of a
column.
Kind regards,
Mark.
------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT
T: +44 (0)1752 791021
F: +44 (0)1752 791023
W: http://www.webbased.co.uk
More information about the postgis-devel
mailing list