<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">No, that won’t return indexed results. To do so will require actually adding a distance index op on the gist_nd indexes (the ones underlying the &&& operator)</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">P.</div> <div id="bloop_sign_1402675920811768064" class="bloop_sign"><div><br></div><span style="font-family:helvetica,arial;font-size:13px"></span>-- <br>Paul Ramsey<br>http://cleverelephant.ca<div>http://postgis.net</div></div> <br><p style="color:#000;">On June 13, 2014 at 8:37:51 AM, hubert depesz lubaczewski (<a href="mailto:depesz@gmail.com">depesz@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>



<title></title>


<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi,<br></div>
For my project I need fast searching for nearest neighbors in 3d
space.<br>
<br></div>
We use postgis geometry with POINT(x y z), but apparently <->
doesn't show 3d distance, but rather 2d. Which is kinda bummer (why
isn't it even listed in docs?).<br>
<br></div>
Anyway - on IRC I was said to:<br>
<br>
CREATE OR REPLACE FUNCTION geometry_distance_centroid(geom1
geometry, geom2 geometry) RETURNS float8 AS 'SELECT
ST_3DDistance($1,$2)' LANGUAGE 'sql' IMMUTABLE STRICT;<br>
<br></div>
And then <-> will work with 3d, but will that also work
*correctly* with gist indexes?<br>
<br></div>
Regards,<br>
<br>
depesz<br></div>


_______________________________________________
<br>postgis-devel mailing list
<br>postgis-devel@lists.osgeo.org
<br>http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel</div></div></span></blockquote></body></html>