[postgis-users] Will it work, or am I overlooking something?

hubert depesz lubaczewski depesz at gmail.com
Wed Jun 18 05:57:03 PDT 2014


On Tue, Jun 17, 2014 at 3:06 AM, Åsmund Tokheim <asmundto at gmail.com> wrote:

> Sorry, but I fail to see such case - if point is close, it will be also
> close on at least one of 3 planes (x,y), (x,z), (y,z)
> Let's say that your table has the points (1, 1, 1000), (1, 2000, 1),
> (2000,1,1) and (2, 2, 2). Unless I'm completely mistaken, a 1. nearest
> neighbour search from (0, 0, 0) using your algorithm would return (1, 1,
> 1000) as the nearest neighbour. The correct point should however be (2, 2,
> 2), which is somewhat close in all planes, but not very close in any plane.
>

Hmm ... I see now the problem - I was working under assumption that correct
point would be "overwritten" by bad one. But in this case - on every
mapping (xy, xz, yz) - the overwrite happens by different point. Good
catch, thanks.

> My only concern is that the <-> operator won't use the index when you
apply an arbitrary function like translate_xz to its input.

It will if I'll index the function, and not the point.

Regards,

depesz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140618/7ad1c0a0/attachment.html>


More information about the postgis-users mailing list