Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:36:39+00:00 2026-06-09T16:36:39+00:00

What type of data should I use to store Lat and Lng from Google

  • 0

What type of data should I use to store Lat and Lng from Google Map into my database?
I’m not sure how many decimal place should I put for length in mysql.

So should I use Decimal, Float etc?
and how much should I put for Length?
Meanwhile, is it good to put index for Lat and Lng in Mysql?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:36:41+00:00Added an answer on June 9, 2026 at 4:36 pm

    I use decimal(10,6) for both lat and lon which gives you a resolution better than 1 meter. (Remember to take the minus sign into account).


    EDIT:

    Quote from the MySQL manual regarding the minus sign on the decimal type:

    Standard SQL requires that DECIMAL(5,2) be able to store any value with
    five digits and two decimals, so values that can be stored in the
    salary column range from -999.99 to 999.99. MySQL enforces this limit
    as of MySQL 5.0.3. Before 5.0.3, on the positive end of the range, the
    column could actually store numbers up to 9999.99. (For positive
    numbers, MySQL 5.0.2 and earlier used the byte reserved for the sign
    to extend the upper end of the range.)

    Source:

    http://dev.mysql.com/doc/refman/5.0/en/fixed-point-types.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

what data type should I use to store small decimal value? Ranging from -50.00
What data type should i use for a SQL column to store Product version
What data type should I use to store HTML content in SQL Server 2008?
What data type should I use if I want to store pdf (1mb-20mb) files?
what data type (string, blob or clob) should i use for my thread body
What type should i use to store time length with MongoDB? I need to
Is there a data type I can use to store a single digit, but
I want to store MAC addresses in one of my database tables, what data-type
In .NET which data type do you use to store list of strings ?
Novice question. What collection type should I use to store such structure? Files collection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.