[postgis-users] distance function only supports 2d?
Gerry Creager N5JXS
gerry.creager at tamu.edu
Sun Feb 8 00:07:16 PST 2004
Think of 3d as "slant range" between 2 sites. The question becomes: Do
you accommodate curvature in the inherent calculation or is it a planar
calculation?
gerry
Paul Ramsey wrote:
> 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
>>>>
>>
>>
>
>
--
Gerry Creager -- gerry.creager at tamu.edu
Network Engineering -- AATLT, Texas A&M University
Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.847.8578
Page: 979.228.0173
Office: 903A Eller Bldg, TAMU, College Station, TX 77843
More information about the postgis-users
mailing list