Latitude/Longitude data types and functions

Started by CSNover 21 years ago8 messagesgeneral
Jump to latest
#1CSN
cool_screen_name90001@yahoo.com

I looked through the docs and contrib, but didn't see
anything related to storing and using latitude and
longitude values. I have data in the form of 12��� 34'
N, 12��� 34' W.

Would any of the geometric data types work well for
this type of data? Or just convert them to decimals?
Are there any functions for converting lat/long
to/from decimals/DDMMSS NSEW?

Thanks

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

#2Bruce Momjian
bruce@momjian.us
In reply to: CSN (#1)
Re: Latitude/Longitude data types and functions

Didn't /contrib/earthdistance help?

---------------------------------------------------------------------------

CSN wrote:

I looked through the docs and contrib, but didn't see
anything related to storing and using latitude and
longitude values. I have data in the form of 12��� 34'
N, 12��� 34' W.

Would any of the geometric data types work well for
this type of data? Or just convert them to decimals?
Are there any functions for converting lat/long
to/from decimals/DDMMSS NSEW?

Thanks

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3CSN
cool_screen_name90001@yahoo.com
In reply to: Bruce Momjian (#2)
Re: make install (in contrib) and PGDATA

Ah, that should work.

The README for contrib/cube states:

To install the type, run
make
make install

For this to work, make sure that:
. the cube source directory is in the postgres contrib
directory
. the user running "make install" has postgres
administrative authority
. this user's environment defines the PGLIB and PGDATA
variables and has
postgres binaries in the PATH.

So I did:
$ export PGLIB=/usr/lib/pgsql
$ export PGDATA=/var/lib/pgsql/data
$ make
$ make install
mkdir /usr/share/pgsql/contrib
make: *** [installdirs] Error 1

$ pg_config --configure
'--prefix=/usr' '--datadir=/usr/share/pgsql'
'--libdir=/usr/lib/pgsql'
'--includedir=/usr/include/pgsql'

Is PGLIB and/or PGDATA ignored? What should I do so
'make install' works?

Thanks,
CSN

--- Bruce Momjian <pgman@candle.pha.pa.us> wrote:

Didn't /contrib/earthdistance help?

---------------------------------------------------------------------------

CSN wrote:

I looked through the docs and contrib, but didn't

see

anything related to storing and using latitude and
longitude values. I have data in the form of 12���

34'

N, 12��� 34' W.

Would any of the geometric data types work well

for

this type of data? Or just convert them to

decimals?

Are there any functions for converting lat/long
to/from decimals/DDMMSS NSEW?

Thanks

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------(end of

broadcast)---------------------------

TIP 2: you can get off all lists at once with the

unregister command

(send "unregister YourEmailAddressHere" to

majordomo@postgresql.org)

-- 
Bruce Momjian                        | 
http://candle.pha.pa.us
pgman@candle.pha.pa.us               |  (610)
359-1001
+  If your life is a hard drive,     |  13 Roberts
Road
+  Christ can be your backup.        |  Newtown
Square, Pennsylvania 19073

__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: CSN (#1)
Re: Latitude/Longitude data types and functions

CSN <cool_screen_name90001@yahoo.com> writes:

I looked through the docs and contrib, but didn't see
anything related to storing and using latitude and
longitude values.

I think you want to look at the PostGis project:
http://postgis.refractions.net

regards, tom lane

#5Peter Eisentraut
peter_e@gmx.net
In reply to: CSN (#3)
Re: make install (in contrib) and PGDATA

CSN wrote:

For this to work, make sure that:
. the cube source directory is in the postgres contrib
directory
. the user running "make install" has postgres
administrative authority
. this user's environment defines the PGLIB and PGDATA
variables and has
postgres binaries in the PATH.

These installation instructions are completely bogus. The new text that
I just committed reads:

The user running "make install" may need root access; depending on how
you configured the PostgreSQL installation paths.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#6Janko Richter
jankorichter@yahoo.de
In reply to: CSN (#1)
Re: Latitude/Longitude data types and functions

CSN wrote:

I looked through the docs and contrib, but didn't see
anything related to storing and using latitude and
longitude values. I have data in the form of 12� 34'
N, 12� 34' W.

Would any of the geometric data types work well for
this type of data? Or just convert them to decimals?
Are there any functions for converting lat/long
to/from decimals/DDMMSS NSEW?

Thanks

Have a look at pgSphere
http://gborg.postgresql.org/project/pgsphere/projdisplay.php

It has no release yet, but I want to do it this summer.
Check it out and send me possible bug reports.

Regards,
Janko Richter

#7Andrew Ayers
aayers@eldocomp.com
In reply to: Janko Richter (#6)
Re: Latitude/Longitude data types and functions

Janko Richter wrote:

CSN wrote:

I looked through the docs and contrib, but didn't see
anything related to storing and using latitude and
longitude values. I have data in the form of 12° 34'
N, 12° 34' W.

Would any of the geometric data types work well for
this type of data? Or just convert them to decimals?
Are there any functions for converting lat/long
to/from decimals/DDMMSS NSEW?

Thanks

Have a look at pgSphere
http://gborg.postgresql.org/project/pgsphere/projdisplay.php

It has no release yet, but I want to do it this summer.
Check it out and send me possible bug reports.

pgSphere looks interesting, for spherical coordinate systems. Does
anyone know of a similar module or project for cartesian coordinate systems?

Andrew Ayers
Phoenix, Arizona

-- CONFIDENTIALITY NOTICE --

This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email, and delete the message. Thank you.

#8Paul Ramsey
pramsey@cleverelephant.ca
In reply to: Andrew Ayers (#7)
Re: Latitude/Longitude data types and functions

Andrew Ayers wrote:

Have a look at pgSphere
http://gborg.postgresql.org/project/pgsphere/projdisplay.php

It has no release yet, but I want to do it this summer.
Check it out and send me possible bug reports.

pgSphere looks interesting, for spherical coordinate systems. Does
anyone know of a similar module or project for cartesian coordinate systems?

Sure, PostGIS: http://postgis.refractions.net

Paul