Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1327
  • Last Modified:

How to Inject latitude and longitude into a huge Access db

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
PredatorGR
Asked:
PredatorGR
  • 3
  • 3
1 Solution
 
HainKurtSr. System AnalystCommented:
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
 
PredatorGRAuthor Commented:
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
 
HainKurtSr. System AnalystCommented:
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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
HainKurtSr. System AnalystCommented:
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
 
nanharbisonCommented:
You can get a free database of zipcodes with latitude and longitude here
http://www.boutell.com/zipcodes/
0
 
PredatorGRAuthor Commented:
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
 
PredatorGRAuthor Commented:
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now