[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-devel
Subject:    Re: [postgis-devel] Distance operator in presence of M
From:       Paul Ramsey <pramsey () cleverelephant ! ca>
Date:       2015-06-10 16:29:31
Message-ID: etPan.557865ef.507ed7ab.89bf () Crane ! local
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Oh, a 2d semantic on the n-d index, I see. Uh, I guess we could, because More, but \
maybe working on the ticket list is a better idea…  

--  
http://postgis.net
http://cleverelephant.ca


On June 10, 2015 at 9:27:42 AM, Sandro Santilli (strk@keybit.net) wrote:

An update:  
I've added a |=| operator (mnemonic: it's two rotated T for time, and  
an equal sign forms at the center for "syncronized") that returns  
the same as a new ST_DistanceCPA function (distance between the points  
of closest approach).  

When building PostGIS against PostgreSQL 9.5+, this operator is capable  
of using an N-dimensional index (where it was added with strategy number 20).  

It's been an interesting excercise as it shows you can have different  
operators with different "distance" semantic all using the same index.  
I'm now wondering if we should then add <-> to the N-D operator too now.  

--strk;  

On Thu, Jun 04, 2015 at 09:37:59PM +0200, Sandro Santilli wrote:  
> On Thu, Jun 04, 2015 at 11:00:41AM -0700, Paul Ramsey wrote:  
> > Yes, I'd cry, because then KNN won't work. You'd have to also  
> > figure out how to implement a closest approach model that works on index  
> > keys, such that the closest-approach distance between two keys was always  
> > less than the same distance between two actual objects.    
> 
> That shouldn't be a big problem.  
> 
> Time can only make the minimum distance between two trajectories _larger_  
> than it is in space. That is, while spatial only minimum distance is the  
> distance between any point in one geometry to any point in another,  
> spatio-temporal one reduces the possible pairs to only those points having  
> the same T (M) value.  
> 
> So by only computing the spatial distance between keys (discarding M)  
> would already ensure it is less (or equal) than the same distance between  
> any two actual objects below those keys. Maybe not optimal, but should work.  
> 
> --strk;  


[Attachment #5 (text/html)]

<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;">Oh, a 2d semantic on the n-d index, I see. Uh, I guess we \
could, because More, but maybe working on the ticket list is a better \
idea…&nbsp;</div> <div id="bloop_sign_1433953730071271936" \
class="bloop_sign"><div><br></div><span \
style="font-family:helvetica,arial;font-size:13px"></span>--&nbsp;<br><span>http://pos \
tgis.net</span><div><span>http://cleverelephant.ca</span></div><div><br></div></div> \
<br><p style="color:#000;">On June 10, 2015 at 9:27:42 AM, Sandro Santilli (<a \
href="mailto:strk@keybit.net">strk@keybit.net</a>) wrote:</p> <blockquote type="cite" \
class="clean_bq"><span><div><div></div><div>An update: <br>I've added a |=| operator \
(mnemonic: it's two rotated T for time, and <br>an equal sign forms at the center for \
"syncronized") that returns <br>the same as a new ST_DistanceCPA function (distance \
between the points <br>of closest approach).
<br>
<br>When building PostGIS against PostgreSQL 9.5+, this operator is capable
<br>of using an N-dimensional index (where it was added with strategy number 20).
<br>
<br>It's been an interesting excercise as it shows you can have different
<br>operators with different "distance" semantic all using the same index.
<br>I'm now wondering if we should then add &lt;-&gt; to the N-D operator too now.
<br>
<br>--strk;
<br>
<br>On Thu, Jun 04, 2015 at 09:37:59PM +0200, Sandro Santilli wrote:
<br>&gt; On Thu, Jun 04, 2015 at 11:00:41AM -0700, Paul Ramsey wrote:
<br>&gt; &gt; Yes, I'd cry, because then KNN won't work. You'd have to also
<br>&gt; &gt; figure out how to implement a closest approach model that works on \
index <br>&gt; &gt; keys, such that the closest-approach distance between two keys \
was always <br>&gt; &gt; less than the same distance between two actual \
objects.&nbsp; <br>&gt;  
<br>&gt; That shouldn't be a big problem.
<br>&gt;  
<br>&gt; Time can only make the minimum distance between two trajectories _larger_
<br>&gt; than it is in space. That is, while spatial only minimum distance is the
<br>&gt; distance between any point in one geometry to any point in another,
<br>&gt; spatio-temporal one reduces the possible pairs to only those points having
<br>&gt; the same T (M) value.
<br>&gt;  
<br>&gt; So by only computing the spatial distance between keys (discarding M)
<br>&gt; would already ensure it is less (or equal) than the same distance between
<br>&gt; any two actual objects below those keys. Maybe not optimal, but should work.
<br>&gt;  
<br>&gt; --strk;
<br></div></div></span></blockquote></body></html>



_______________________________________________
postgis-devel mailing list
postgis-devel@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic