Cernunnos Morrigu (cmorrigu) wrote in php,
Cernunnos Morrigu
cmorrigu
php

  • Mood:

GPS, Maps, Zip Codes, Addresses and such

I'm working on creating some tools (PHP/MySQL) on one of my websites to help a user tell where things are. Generically, I will probably put this to use in several ways at some point - I just need a bit of help to start with. The budget is $0, so there will be no buying of commercial map data.

Scenario:
1) User A inputs location data - say, for SSO, it's a store that sells ShadowRun books. This information includes address, city, state, zip, country, phone, etc.
2) User B is going on a trip to Town Z, and wants to know which of these locations are nearby, so they input address Y and a radius of M miles.
3) The display shows a map of town Z with a radius of M miles centered around addess Y, and a numer N of locations X are indicated with icons on the map. Along with this, there is a table with a list of N locations and a distance between Y and X for each.
*) I would also like to be able to create a state-wide or regional default map to show as a default.

Work In Progress:
What I have been able to do so far, thanks to some links I found, is to use the old US Census Zip data that is floating around to give an approximate distance based on zip code. This is pretty inaccurate at best, but it does at least give some idea.

What I think the next step is would be to find a way to get a more accurate lat/long for each address, and use the zip only as a fallback if that method fails. This would increase the accuracy by a significant amount. Any ideas on where/how to implement such a thing would be welcome.

The big step would be actually mapping into an image. I have looked around quite a bit for information on creating images and maps, but have yet to find anything that I can relate well enough to to work with. I'm looking for an example not too far from this scenario to work from. I magine a basic way to accomplish this task would be to find a state outline map and the lat/long that equate with each corner, then use those as a base to map the icon points... somehow. That would at least be a place to start from, and could probably be done with freely available data. To actually generate M radius maps from address Y would be a bit trickier, I imagine. Any thoughts as to the methods, code, sites, data, or experience in creating such a thing are welcome.

Thanks.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 13 comments