co.ador Posted December 17, 2009 Share Posted December 17, 2009 What would be the best approach to build an latitude and longitude script. I am using the following table structure CREATE TABLE IF NOT EXISTS `zip_code` ( `id` int(1) NOT NULL, `zip` varchar(5) NOT NULL, `state` char(2) NOT NULL, `latitude` varchar(10) NOT NULL, `longitude` varchar(10) NOT NULL, `city` varchar(50) DEFAULT NULL, `full_state` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `zip` (`zip`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5837 ; -- Link to comment https://forums.phpfreaks.com/topic/185525-looking-for-a-latitude-and-longitude-script/ Share on other sites More sharing options...
teamatomic Posted December 17, 2009 Share Posted December 17, 2009 To do what? Get lat and long? Map it to something? Thats a fairly open ended question. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/185525-looking-for-a-latitude-and-longitude-script/#findComment-979483 Share on other sites More sharing options...
co.ador Posted December 17, 2009 Author Share Posted December 17, 2009 to look for items within certain mileage range from a zip code. Link to comment https://forums.phpfreaks.com/topic/185525-looking-for-a-latitude-and-longitude-script/#findComment-979486 Share on other sites More sharing options...
mrMarcus Posted December 17, 2009 Share Posted December 17, 2009 to look for items within certain mileage range from a zip code. well, that narrows it down. how do you plan on displaying the results? where are you getting these "items"? are you incorporating a mapping service such as google, yahoo, etc.? do you already have the lat's and long's, or do you need to do reverse geocoding to retrieve those specs? it's almost as though you're trying to give the least amount of information possible. Link to comment https://forums.phpfreaks.com/topic/185525-looking-for-a-latitude-and-longitude-script/#findComment-979505 Share on other sites More sharing options...
salathe Posted December 17, 2009 Share Posted December 17, 2009 Surely a zip code doesn't map directly to a lat-lon pair: Joe Bloggs could live on the border of ZipA and ZipB, would your software put him 0 miles from either of them? Link to comment https://forums.phpfreaks.com/topic/185525-looking-for-a-latitude-and-longitude-script/#findComment-979520 Share on other sites More sharing options...
co.ador Posted December 17, 2009 Author Share Posted December 17, 2009 don't take me wrong, I don't have the minimal idea of what is needed to develop this topic in specific. as you guys request I get to formulate what I have in mind. I have been comparing the latitude and longitudes of Google with the database I have and the numbers are different, Is that possible to use the ones from google? I have a database populated in php myadmin even though it sounds like is old. For your first question don't have any idea of what you mean? i have a form, input a zip code that form action takes me to page2.php then in page2.php all the items are displayed within certain mileage range from a zip code entered. As for your second question I am getting those item from a database table, that databse uses many-to-many relationship. those tables usin many-to-many are zip-codes, items, zip-codes-to-items, etc. as I said I plan to look items within an specific milage range from a zip code specified by the user. don't know if more information is needed Excuse me is just that I don't have any idea about this topic, therefor don't have the exact questions. Link to comment https://forums.phpfreaks.com/topic/185525-looking-for-a-latitude-and-longitude-script/#findComment-979522 Share on other sites More sharing options...
co.ador Posted December 17, 2009 Author Share Posted December 17, 2009 so it is not exact then. Link to comment https://forums.phpfreaks.com/topic/185525-looking-for-a-latitude-and-longitude-script/#findComment-979524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.