Latitude Longitude Finder

Posted on 2006-03-20
Last Modified: 2013-12-12
Is there some type of pre existing PHP app that I can include on my site that will allow a user to enter a street address, city, state, zip etc and then get the lattiude and longitude of that address?


My page records address, city, etc. and writes it to a database. Is there code I can add to the write process that will add lattitude and longitude points to the database by using the data that the user inputs?
Question by:lvollmer
    LVL 15

    Expert Comment

    Hm... that's kind of a complex thing to add to a web site, or at least I would think so.  You could look into Google Maps, but I don't think they support the actual conversion to latitude/longitude:

    There's is a site called Geocoder that has an available web service that you can subscribe to for getting regular coordinates from mailing addresses:

    Other sites that give latitude/longitude, but may not have any kind of developer options:

    Hope that helps ;)


    Author Comment

    I am learning that this is a real pain, and something that a lot of developers are looking for.
    LVL 15

    Accepted Solution

    If you want to do it yourself, without paying for a service, then see this tutorial, which shows you how to do geocoding with PHP and MySQL in a step-by-step process:

    There's also a Perl module that is specifically for getting the latitude/longitude:
    Both of these use TIGER/Line data provided for free by the US Census Bureau:

    All of this may be a major headache for anyone other than an experienced programmer, though.  However, I have not personally tried implementing a feature like this before, so perhaps it's easier than it looks ;)

    Author Comment

    I have really lucked out. Turns out the data I am using has a seperate table with a unique key that links lat's and long's.

    Thanks for the help!

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now