RE: Lat/Long storage?

2001-06-26 Thread Shankar Unni

NUMBER(8,5). You'll need around 5 digits after the decimal point. (Think GPS
accuracy == 10 meters for high-grade, 100 m for dumbed-down civilian use. At
the equator, that's 0.9 or 0.0009 degrees respectively. At higher
latitudes, that'd be correspondingly less.)

If you value accuracy, DON'T USE FLOAT. Float has only 6-7 digits of
accuracy, which, if you take out the 3 digits before the ., leave you with
only 3 decimal places after (== roughly 1 km - too rough).

Use Double (which would be 8 characters), or use number (8,5) or number
(7,4), which are approximately the same size. The latter are easier to work
with for display purposes, the former for computation purposes. Take your
pick.  If you use NUMBER(#,#), you should make sure that internally, you
convert them directly to and from double to preserve the accuracy of the
numbers. 

 -Original Message-
 From: Nelson Goforth [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 25, 2001 2:03 PM
 To: [EMAIL PROTECTED]
 Subject: Lat/Long storage?
 
 
 I need to store latitude and longitude in a MySQL table.  It needs to 
 allow human entry.  Do you have a preferred storage technique for 
 these numbers?
 
 Nelson Goforth
 -- 
 



RE: Lat/Long storage?

2001-06-25 Thread Johnny Withers


mysql desc zipcodes;
+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra  |
+---+--+--+-+-++
| id| int(10) unsigned |  | PRI | NULL| auto_increment |
| zipcode   | char(5)  |  | MUL | 0   ||
| latitude  | double(6,4)  | YES  | | NULL||
| longitude | double(6,4)  | YES  | | NULL||
+---+--+--+-+-++


works ok for me..


-Original Message-
From: Nelson Goforth [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 4:03 PM
To: [EMAIL PROTECTED]
Subject: Lat/Long storage?


I need to store latitude and longitude in a MySQL table.  It needs to 
allow human entry.  Do you have a preferred storage technique for 
these numbers?

Nelson Goforth
-- 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php