[postgis-devel] Bugs in gserialized_gist_compress_2d

Alexander Korotkov aekorotkov at gmail.com
Fri Sep 20 03:42:56 PDT 2013


On Sun, Sep 15, 2013 at 1:26 AM, Paul Ramsey <pramsey at cleverelephant.ca>wrote:

> We talked about invalid keys, and we're going to need some. I'm going to
> have to backtrack and remember where/when we did this last time. Basically
> any instance of GEOMETRY EMPTY, or a geometry with NaN coordinates, or Inf
> coordinates, should generate an invalid key (is there any way to just leave
> it out of the index, since that's effectively what we want anyways...)


General idea is that index scan must give same results as sequential scan.

Generally there are 3 cases: inf coordinates, nan coordinates, lower bound
greater than upper bound.
Let's consider them:
1) inf coordinates
I don't understand why you're so against inf coordinates. For example, box
with infinite upper bound is legal geometrical object. Probably, there are
some use cases where infinite bounds are useful. However, if you would like
to prohibit results of index scans with infinite bounds, you should
corrects operators itself first. Otherwise, it would be inconsistent
behaviour. The only index operator is &&&. So it wouldn't be hard to make
index scans and sequential scans consistent themselves.
2) NaN coordinates
Any single NaN coordinate makes &&& operator always return false. So, in
this case you can do whatever: leave box3df as is or replace it with all
NaNs.
3) lower bound is greater than upper bound
I wonder how it could be possible. Bug in lwgeom? If it could be caused
only by bug then I think trigger an error is proper solution for this case.

------
With best regards,
Alexander Korotkov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20130920/0c4a16c4/attachment.html>


More information about the postgis-devel mailing list