tags:

views:

281

answers:

7

what should be the data type of latitudes and longitudes in general

+2  A: 

In MySQL, it should be Point, so that you can run efficient SPATIAL queries.

Quassnoi
Could you please link to any documentation about this data type? Some googling seems to confirm its existence, but I can't find it in the official docs. Thanks!
deceze
@deceze: first Google result for `mysql point` yields this: http://dev.mysql.com/doc/refman/5.0/en/gis-class-point.html
Quassnoi
Weird. I guess I was googling for "point data type mysql" or something to that extend. A search for "point" on the MySQL site only yielded references to "floating-point"...
deceze
A: 

I would say double if you want to store them in separate columns.

J.W.
A: 

I have used varchar2(40) under Oracle.

blispr
may i know y u r using varchar
srinivas
WTF should previous comment mean? :mad: I looked at some english dictionaries, but words like "y", "u" and "r" seem have no meaning.Sorry, english is not my language.
Arvo
Is "WTF" part of your language? If u know what "WTF" means - u should know what "y" and "u" mean.
Jim Evans
A: 

Depends on the language/DB you are using. In general, its preferable to have it as float, in case of programming language. and NUMBER(x,y) in case of sqlplus.

Roopesh Majeti
+2  A: 

For SQL Server 2000 and 2005, I've seen Numeric(15,10) for each coordinate used most often although I cannot speak to the correctness of that.

Sql Server 2008 has new spatial data types. See here for more on those (its a little more than half way down the page).

Rob Allen
A: 

look i have implemented google maps in my website. I've used blob for latitude and longitudes(just to be on the safer side)

ROHAN CHAVAN
Using BLOBs to store Geographical locations is totally unnecessary. The precision of a Geographic location is only 6 digits Lat, 6 digits Long
TreeUK
A: 

in general int (on Intel x86 in 32bit mode) is sufficient (in 100 (")representation). sign is used to indicate N/S and E/W. brgds/gabriel