from Hacker News

If you ever wanted to know the lengths of most US city longitudes & latitudes

by cgrusden on 5/14/12, 11:26 PM with 2 comments

Right before I ran a database migration to create the tables to house the lat & long information for US Cities I realized that longitude and latitude strings could never be over 100 characters long. Instead of blindly using 24 characters or even 20, I wanted to know what I was working with for US Cities ONLY.

The small gist below shows the very small range of length for the lat & longs.

https://gist.github.com/2698035

spoiler: It's between 9-11 for latitude, and 11-12 for longitude

  • by mapster on 5/15/12, 6:34 PM

    I recommend using six decimal places for best accuracy, so 34.100912, -121.187176