[postgis-users] distance function only supports 2d?

Paul Ramsey pramsey at refractions.net
Wed Feb 4 11:43:33 PST 2004


Ah, my fault for not reading your mail carefully.
What semantics would a 3D distance have? The 2D distance is the minimum 
distance between the two objects. The 3D distance could be calculated 
using the minimum 2D distance between the objects, or the minimum 3D 
distance, if you see what I mean.

(a) find the two points that are the minimal 2D distance between the 
objects, then use them to calculate the 3D distance
(b) find the two points that are the minimal 3D distance between the 
objects, and use that distance

I know, (a) sounds stupid, but you have to remember that our features 
are not really 3D, they are 2.5D, so a 2.5D calculation might make more 
"sense". Hard call.

P.

Falko Steinmetz wrote:

> That's the function I used for my workaround. But I first need to
> build a line out of the 2 points. As I couldn't figure out how to do
> this in the same SQL statement I use for the length3d I have to do it
> in a loop. Thats fine for everything except one task - and thats the
> one I need. In this case I need the distance function in the WHERE
> statement. With a 3d distance function that works with points,
> my program would need about 1000 SQL queries to get a result, with the
> workaround it needs about 100.000.
> The only solution is now to calcualte a matrix and store it into a
> table. On thy fly calculating is to slow with this workaround.
> 
> But thanks for your assistance so far!
> 
> Falko
> 
> 
> PR> length3d (geometry);
> 
> PR> Falko Steinmetz wrote:
> 
> 
>>>Thanks for the answer,
>>>
>>>I searched the funcitons list and postgis.sql but I didnŽt find anything.
>>>Despairingly I tried every function in the list with 2 geometry
>>>arguments but found nothing.
>>>Are you sure that it is somewhere in there?
>>>
>>>Thanks
>>>Falko
>>>
>>>PR> Check the functions list, or postgis.sql. The default is 2d, but there 
>>>PR> is a 3d variant in there somewhere.
>>>PR> P
>>>
>>>PR> On Wednesday, February 4, 2004, at 01:53 AM, strk wrote:
>>>
>>>
>>>
>>>>>falko.steinmetz wrote:
>>>>>
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>is it possible, that the distance function only support 2d?
>>>>>>I use postgis 0.8.1 and when I calculate the distance between the
>>>>>>points 24/33/20 and 0/0/0 I get 40.80 - the distance between
>>>>>>24/33 and 0/0.
>>>>>>Is this a bug or doesn't the function support 3d points?
>>>>>
>>>>>AFAICT only 2d distance is supported.
>>>>>--strk;
>>>>>_______________________________________________
>>>>>postgis-users mailing list
>>>>>postgis-users at postgis.refractions.net
>>>>>http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>>>
>>>
>>>PR>       Paul Ramsey
>>>PR>       Refractions Research
>>>PR>       Email: pramsey at refractions.net
>>>PR>       Phone: (250) 885-0632
>>>
>>>PR> _______________________________________________
>>>PR> postgis-users mailing list
>>>PR> postgis-users at postgis.refractions.net
>>>PR> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
> 
> 


-- 
       __
      /
      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632
      \_




More information about the postgis-users mailing list