RPG Forums

RPG Forums (http://forum.juhlin.com/index.php)
-   Twilight 2000 Forum (http://forum.juhlin.com/forumdisplay.php?f=3)
-   -   Geocoding (was "Canon Mexican Locations") (http://forum.juhlin.com/showthread.php?t=998)

pmulcahy11b 07-12-2009 08:13 PM

Quote:

Originally Posted by kato13
I've got 5 days until my oilfield processing is done due to a Google limitation on how often you can search for lat/long locations (once every 1.7 seconds)...

How'd you get that search automated?

kato13 07-12-2009 08:42 PM

Quote:

Originally Posted by pmulcahy11b
How'd you get that search automated?

I do most of my stuff via a perl backend on my webserver but there is a neat pure html/javascript way to do it.

First you need to get a map key for your website.
http://code.google.com/apis/maps/signup.html

Second view and copy source from this page.
http://maps.juhlin.com/maps/geomulti_demo.htm

Third Replace my map key with yours.
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=***your_key_here***" type="text/javascript"></script>


Fourth Put the addresses you want in here.

var addresses = [
"PAWNEE EAST, OK",
"MEHAN NE, OK",
"RATTLESNAKE, OK",
"ORLANDO EAST, OK",
"HARTSHORNE, OK"
];


Fifth upload the file to your webserver and view it. It will process about one record every 2 seconds.

It works nice up to about 1000 records then the browser slows down so I suggest breaking the data down into ~1000 record chunks.

Edit; Oho another thing is that is is usually best to provide a full state name to Google as they will often interpret CA as Canada and CO as Columbia and KY as one of the Former Soviet republics.

kato13 07-12-2009 08:46 PM

Here is another source for a simpler multi geocode solution.

http://www.batchgeocode.com/

I really don't like it though. It uses Yahoo's geocode model which tries to always return something. If it can't find a city within a state it returns the center of the state. Google tells you when it cant find something which is much more useful IMO.


All times are GMT -6. The time now is 07:04 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.