Re: OT: spherical geometry (Re: earthdistance is not giving ...)

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Holger Klawitter <lists(at)klawitter(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: OT: spherical geometry (Re: earthdistance is not giving ...)
Date: 2004-10-06 14:30:11
Message-ID: 20041006143011.GA15406@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 06, 2004 at 08:52:55 +0200,
Holger Klawitter <lists(at)klawitter(dot)de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sunday 03 October 2004 20:22, Bruno Wolff III wrote:
> > Latitudes greater than 90 degrees have a reasonable
> > meaning and it can be useful to use 0 to 180 instead of -90 to 90.
>
> Just a curious question: What is 100°N latitude supposed to mean?

It means 80 degrees north and longitude + 180 degrees.

I shouldn't have used 0 to 180 as the example for latitude, because it
really needs to range from 0 to 360, since 0 to 180 is all in the
northern hemisphere. Longitude works similarly in that you can use
0 to 360 instead of -180 to +180.

The advantage of this is that your application can do things like add degrees
to a position and not have to check for wrapping around. You can get similar
issues due to rounding after switching coordinate systems where you might
get a value slightly greater than 90 degrees for latitude or get a value
slightly greater than 180 degrees for longitude.

As long as the principal values are returned when going from cartesian
coordinates (which is how earth distance stores points) to latitude
and longitude accepting values outside of the principal ones when
going from spherical coordinates to cartesian coordinates isn't a problem.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Justin Wyer 2004-10-06 14:34:50 Re: two digit years in inserts
Previous Message Tom Lane 2004-10-06 14:23:52 Re: two digit years in inserts