Cities Within A 50 Mile Radius

Dynamically redirect a web surfer based on their geographic location.
Can also insert localized, geographic content into a web page.

Moderators: Moderators, GeobytesAdmins

Cities Within A 50 Mile Radius

Postby TDietsch » Thu Oct 18, 2007 5:15 pm

Is there any way to get a list of all cities and their codes within a 50 mile radius? The Online Location String Generator lists up to 60 km or 37 miles.
Tony
TDietsch
 
Posts: 3
Joined: Thu Oct 18, 2007 4:22 pm

Re: Cities Within A 50 Mile Radius

Postby Adrian » Thu Oct 18, 2007 6:03 pm

TDietsch wrote:Is there any way to get a list of all cities and their codes within a 50 mile radius? The Online Location String Generator lists up to 60 km or 37 miles.
Yes, one way would be like this:
Code: Select all
http://glrs.geobytes.com/map.htm?GetNearByCities&Radius=50&LocationCode=USILCHIC&template=<geobytes%20city>,%20&units=miles
or in km...
http://glrs.geobytes.com/map.htm?GetNearByCities&Radius=100&LocationCode=USILCHIC&template=<geobytes%20city>,%20&units=km

and as may be obvious, your can change the template parameter to get back which ever parameter that you may require. The available parameters are listed here: http://www.geobytes.com/TagsHeaders.htm
So to return the location codes of near by cities, along with the the city names, you could use:
Code: Select all
http://glrs.geobytes.com/map.htm?GetNearByCities&Radius=50&LocationCode=USILCHIC&template=<geobytes%20locationcode>%20<geobytes%20city>,%20&units=miles

That is assuming that you were looking for a hosted solution, however there are many other ways - such as downloading our "almost free" GeoWorldMap database and then using the sample queries that are listed here: http://forums.geobytes.com/viewtopic.php?t=352
And of course if you are running your own GeoSelect server, then you could direct the above sample requests at it, rather then our server at glrs.geobytes.com

In any case, please let me know if I can assist further.
Adrian
“The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.” - Bertrand Russell
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 840
Joined: Thu Nov 20, 2003 9:58 am

GeoDirection City Radius

Postby TDietsch » Thu Oct 18, 2007 8:18 pm

I am trying to redirect all users within a 50 mile radius of my city using GeoDirection. Do I need to list all of the location codes within that radius to accomplish this or is there a more efficient way?
Tony
TDietsch
 
Posts: 3
Joined: Thu Oct 18, 2007 4:22 pm

Re: GeoDirection City Radius

Postby Adrian » Fri Oct 19, 2007 7:03 am

TDietsch wrote:I am trying to redirect all users within a 50 mile radius of my city using GeoDirection. Do I need to list all of the location codes within that radius to accomplish this or is there a more efficient way?


ok - there are two ways to do this, depending on whether you want to send each city within the specified radius to their own custom page or to a common page for all of the cities within the defined area.

This script uses the -r parameter to direct all visitors from within a 80 kilometer radius of USOHTOLE to a target page called MyPage.html after 5 seconds.
Code: Select all
<script language="Javascript"
src="http://gd.geobytes.com/gd?pages=USOHTOLE -r 80&targetpage=MyPage&ext=html&after=5">
</script>


From what I currently understand of your requirements, it is probably what you are looking for. However there is another way to use this 'radius' facility, and that is "without specifying a target page" as we did in the above example.

If you omit the target page parameter from the above example, then GeoDirection will redirect each city's traffic to its own page - you would need a landing page for each city with in the radius - as the script will automatically redirect to the users 'city page'. (A city page being something like - USOHTOLE.html)

Like I said, this option - without the targetpage parameter is most likely not what you are looking for as you would still need to look up all of the location codes for all of the surrounding cities - and worse still create pages for each city. However, while this might seem like a complete waste of time, it is very handy when the server is dynamically creating the pages on the fly - the URI part of the URL tells the server which page to create, but again, it is probably not of much use when you are creating the pages manually.

Another option as you have indicated is to just include a coma separated list of all of the location codes and then redirect to a nominated page manually - as shown in this example: http://www.geobytes.com/GeoDirection.ht ... tePageName
The advantage of this method, while more complex, is that you get more control.

Please let me know if I can assist further.
Adrian
“The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.” - Bertrand Russell
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 840
Joined: Thu Nov 20, 2003 9:58 am

follow up q on radius q

Postby ExitSpeed » Fri Oct 26, 2007 11:27 pm

so how do we get the response of this code

http://glrs.geobytes.com/map.htm?GetNea ... &template=<geobytes%20city>,%20&units=miles

into a variable to use in our javascript? I need to get the cities around 50 miles of this location, then check that list against my list of BigCities.

any ideas? thanks
ExitSpeed
 
Posts: 6
Joined: Thu Oct 25, 2007 4:14 pm

Postby MattGSO » Wed Jan 23, 2008 4:17 pm

Silly Question:

I'd like to get a list of cities and zips within a 50 mile radius of 27107. I just need the list.

Is there a way to gernate that?
MattGSO
 
Posts: 1
Joined: Wed Jan 23, 2008 4:12 pm

Postby Adrian » Wed Jan 23, 2008 5:15 pm

Sorry, but unfortunately we can not provide all of the zip codes. - try searching Google for "zip codes" - there are a lot of providers there.
Adrian
“The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.” - Bertrand Russell
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 840
Joined: Thu Nov 20, 2003 9:58 am

Re: Cities Within A 50 Mile Radius

Postby gentlebug » Thu Sep 10, 2009 6:26 pm

Can someone help me? I need to find a list of cities within a certain radius. The cities change and so do the distances.
gentlebug
 
Posts: 1
Joined: Thu Sep 10, 2009 6:15 pm

Re: Cities Within A 50 Mile Radius

Postby mandville » Fri Sep 11, 2009 1:38 pm

Such a list is a bit difficult, can you explain how you plan to use it?
Claire. Forum Moderator, Research and GDB Team
http://www.igchosting.com - All your hosting needs under one roof
Impact Global Communications, LLC (mention 'geobytes' for a discount)
User avatar
mandville
Moderator
 
Posts: 407
Joined: Fri Jul 09, 2004 7:56 pm
Location: brighton UK


Return to GeoDirection

Who is online

Users browsing this forum: No registered users and 1 guest