Re: earthdistance compass bearing

From: Jeff Herrin <jeff(at)openhotel(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: earthdistance compass bearing
Date: 2013-06-18 18:16:41
Message-ID: 283807fb-b4bb-48ef-89ef-eb9e36497ab3@aimailbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't need it to be too accurate. We're pushing hotel info into the GDS (sabre, expedia, orbitz, etc). They require airport info relative to the hotel. Example: DFW is 25 miles NW of the property. I thought about just faking it...comparing the hotel's lat/long from the airports. I can probably get N,S,E,W reliably enough, but i'm not sure at what point N becomes NW, etc. That just seems like a really crude bad way to do it, but the alternatives seem unnecessarily complex. I found some examples that use bearing but they all take headings in degrees (which im not seeing in earthdistance). I guess I'm going to have to either setup postGIS or brush up on my trig.

thanks,
altimage

----- Original Message -----

From: "Steve Crawford" <scrawford(at)pinpointresearch(dot)com>
To: "Jeff Herrin" <jeff(at)openhotel(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Sent: Tuesday, June 18, 2013 11:37:10 AM
Subject: Re: [GENERAL] earthdistance compass bearing

On 06/18/2013 10:42 AM, Jeff Herrin wrote:

I'm trying to get a compass bearing (N,S,NW,etc) using earthdistance. I can successfully get the distance between 2 points using either the point or cube method, but I've been struggling with getting the bearing. Any tips?

PostGIS has some functions that may be of use but might be overkill depending on your use but I don't see anything in earthdistance.

What are you trying to solve?

It's one thing if you are looking for a one-degree-accurate magnetic-variation-compensated great-circle heading for a 6,000km flight using WGS84 projection (initial-heading, of course, as it will vary over the course of your travel).

If you just want to be accurate to eight compass-points over a few city-blocks then simple trig is probably more than sufficient.

Cheers,
Steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2013-06-18 18:17:25 Re: Postgres DB crashing
Previous Message AI Rumman 2013-06-18 17:54:09 Re: Postgres DB crashing