Re: How to calculate length of path data without diagonals?

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to calculate length of path data without diagonals?
Date: 2010-12-24 03:14:36
Message-ID: if136s$sag$3@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2010-12-23, Romain Billoir <billoirr(at)gmail(dot)com> wrote:
> --0015175ccf48e6186a049817fc59
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi, i need to calculate some length of path without diagonal. Some examples:
> length((5,5),(6,6))) returns 1.41. I need 2: 5,5 to 5,6 + 5,6 to 6,6.
>
> Is that possible?

It's called "Manhattan distance" look it up, the arithmentic is easy.

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tsutomu Nakajima 2010-12-24 09:06:38 did freese in creating a database cluster
Previous Message Jasen Betts 2010-12-24 03:10:25 Re: Data backup to local duplicate without resetting permissions