pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedWrong distance shown in miles for extension earthdistance
2+ messages / 2 participants
[nested] [flat]
* Wrong distance shown in miles for extension earthdistance
@ 2021-03-22 04:17 PG Doc comments form <noreply@postgresql.org>
2021-03-22 08:49 ` Re: Wrong distance shown in miles for extension earthdistance Magnus Hagander <magnus@hagander.net>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2021-03-22 04:17 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: ipkis76@gmail.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/10/earthdistance.html
Description:
Hi,
I have installed
CREATE EXTENSION CUBE;
CREATE EXTENSION earthdistance;
Post which I ran the following query:
SELECT (POINT (19.974, 72.756)<@> POINT (19.195, 72.959)) AS DISTANCE;
The answer came back as 21.17534 miles whereas the actual distance (as crow
flies) is 55.42 miles which I have checked from 2-3 websites. (Google maps
gives a greater distance which is travel by road & this value has been
ignored).
I know both the places and the distance between both of them cannot be 22
miles. It has to be in excess of 50 miles atleast. What am I missing?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Wrong distance shown in miles for extension earthdistance
2021-03-22 04:17 Wrong distance shown in miles for extension earthdistance PG Doc comments form <noreply@postgresql.org>
@ 2021-03-22 08:49 ` Magnus Hagander <magnus@hagander.net>
0 siblings, 0 replies; 2+ messages in thread
From: Magnus Hagander @ 2021-03-22 08:49 UTC (permalink / raw)
To: ipkis76@gmail.com, Pg Docs <pgsql-docs@lists.postgresql.org>
On Mon, Mar 22, 2021 at 9:27 AM PG Doc comments form
<noreply@postgresql.org> wrote:
>
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/10/earthdistance.html
> Description:
>
> Hi,
> I have installed
> CREATE EXTENSION CUBE;
> CREATE EXTENSION earthdistance;
>
> Post which I ran the following query:
> SELECT (POINT (19.974, 72.756)<@> POINT (19.195, 72.959)) AS DISTANCE;
>
> The answer came back as 21.17534 miles whereas the actual distance (as crow
> flies) is 55.42 miles which I have checked from 2-3 websites. (Google maps
> gives a greater distance which is travel by road & this value has been
> ignored).
>
> I know both the places and the distance between both of them cannot be 22
> miles. It has to be in excess of 50 miles atleast. What am I missing?
By your queasy it looks like you are comparing two points in the Norwegian Sea.
I think you may have swapped your latitude and longitude, and are
actually looking for:
postgres=# SELECT (POINT (72.756, 19.974)<@> POINT (72.959, 19.195))
AS DISTANCE;
distance
--------------------
55.421996899143366
--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-03-22 08:49 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 04:17 Wrong distance shown in miles for extension earthdistance PG Doc comments form <noreply@postgresql.org>
2021-03-22 08:49 ` Magnus Hagander <magnus@hagander.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox