Solved

How to Inject latitude and longitude into a huge Access db

Posted on 2011-03-15
7
1,303 Views
Last Modified: 2012-06-22
Hi Experts,

I currently own a huge Access database with 60.000 records.

Those records have a Name, Address, Area, Postal Code, Phone Number

I want to find the longitude and the latitude of the Address field witch is linked to the Area.

So we have the following schema:

32, Example Street, New York.


I know that i can manually search and add the long/lat into the db, but with 60.000 records this could take a lifetime.

Is there an easier way to do this? Maybe with a php/mysql script, but i don't know how. Can i convert the Access Database to mySQL an do this using a PHP script?


I know that this could generate errors in location, but if we link the postal code to the above schema it's possible to eliminate this.
0
Comment
Question by:PredatorGR
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 56

Expert Comment

by:HainKurt
ID: 35141577
maybe this help

http://geocoder.us/

they ask for $50 for 20K lookup, so in your case $150 :)

but maybe you can find a free geo web service... if you find this, just create a script (vb & asp or an application) loop all records, get the address, call web service, get values, update your db...
if your app crashes, continue with null values in long * lat columns...
0
 

Author Comment

by:PredatorGR
ID: 35141612
Thanks for the ultra fast reply HainKurt.

i bumped on this site earlier on my google search:
http://www.vbdotnetheaven.com/UploadFile/scottlysle/FreeGeocoderVB01242008090945AM/FreeGeocoderVB.aspx

Problem is, i'm not in the US and i don't know how to make an app like that.

i also bumped on this:
http://www.codeforexcelandoutlook.com/excel-vba/latitude-longitude-functions/

Scroll down to Google Maps API returns Latitude/Longitude to see an example.

How i can make this work?
0
 
LVL 56

Expert Comment

by:HainKurt
ID: 35141836
what about this

http://local.yahooapis.com/MapsService/V1/geocode?appid=sGmf70bV34H6QgDaDk.tLer1VOJZEf.P7nZPi2V8MMmFDEQ_f30ByzwxgTI-&street=your  street address&country=ca&zip=XXXXXXXX

it will return you xml which you can save it to somewhere or get the Long & Lat values from here and update your table

or put all your address info in your excel and create a udf and call this function to get values

<?xml version="1.0" ?> 
- <ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:maps" xsi:schemaLocation="urn:yahoo:maps http://local.yahooapis.com/MapsService/V1/GeocodeResponse.xsd">
- <Result precision="address">
  <Latitude>33.554939</Latitude> 
  <Longitude>-75.748924</Longitude> 
  <Address>xxxxxxx</Address> 
  <City>Mississauga</City> 
  <State>ON</State> 
  <Zip>L5M</Zip> 
  <Country>CA</Country> 
  </Result>
  </ResultSet>

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 56

Accepted Solution

by:
HainKurt earned 500 total points
ID: 35141901
this url works fine for Canada

http://local.yahooapis.com/MapsService/V1/geocode?appid=sGmf70bV34H6QgDaDk.tLer1VOJZEf.P7nZPi2V8MMmFDEQ_f30ByzwxgTI-&street=Your City Address Here&city=Your City&state=NA&country=Caountry Here

on the page there are lots of excel functions... use one of them, create the url and get the result in xml
extract Long & latitude and update cells
then from excel update your db (copy paste is easiest way)
0
 
LVL 17

Expert Comment

by:nanharbison
ID: 35143096
You can get a free database of zipcodes with latitude and longitude here
http://www.boutell.com/zipcodes/
0
 

Author Comment

by:PredatorGR
ID: 35146838
Thanks all the experts for the replies.

I finally made it this way:

entered the excel data, i pressed the "Validate & Set Options" so i can validate witch cell is witch according to the Address, postal code etc.
i pressed the "Make Google Map"
after pressing the button i waited for the geocoding to finish
After the job is done, i pressed "Save And Continue"
i entered the name, description and my email on the box,
Waited a few seconds for the map to be created
Then i scrolled all the way down from the browser's side bar and i downloaded the goolgle KML file
i renamed the file to .xml from .kml and i imported it into excel
After using those 2 formulas: =LEFT(E2;FIND(",";E2)-1)and
=MID(E2;FIND(",";E2)+1;FIND(",";E2;FIND(",";E2)+1)-FIND(",";E2)-1)
i teared down the format 23.7515439,37.9776524,0 in two new cells (lang,lat) to two separate values of 23.7515439 and 37.9776524 (without the ,0 in the end). If someone ever use this method, you should change the E2,E1 field to the according fields of his excel file.

I hanv't tried yet to see how many records this site can translate, i think 2.500 is maximum so i have to split down the work to multiple browsers.
0
 

Author Closing Comment

by:PredatorGR
ID: 35146857
Thanks for your help!! much appreciated! i think the other way is much easier, but you pointed on the right way of xml.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

628 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