I second Geokit, I've used it in almost every application I've built.
However, the main purpose of geokit is for getting the latitude and
longitude of a location and then performing distance calculations between
that location and other locations (such as finding all locations within a
certain distance of another location).

If you want to do something such as list cities or counties, you'll probably
need to get something like a 'location database' and slice and dice it for
your needs. Unfortunately they usually cost money.

An alternative solution to showing all the articles in the same county as a
city would be to use geokit to show all the articles within a certain
distance of a city.  That could provide your users with a similar
experience.

Hope that helps.

On Mon, Aug 24, 2009 at 9:46 AM, Billee D. <[email protected]> wrote:

>
> You may or may not have seen this too, but it is a big part of every
> geocoding Rails app I build:
>
> http://geokit.rubyforge.org/
>
> It adds a number of geocode-specific methods to ActiveRecord which
> allow you to query records based on their proximity to a location
> (e.g. @locations = Location.find(:all, :origin => @address, :within =>
> @within, :order => 'distance')). It can also automatically geocode a
> location upon create using either Google, Yahoo, or GeoNames. You
> provide your API key and GeoKit handles the grunt work. Very handy
> tool. :-)
>
> Good luck with your project.
>
> On Aug 23, 7:54 am, Peter Laurens <[email protected]>
> wrote:
> > This is a broad question to get me started in the right direction:
> >
> > I would like to provide a location-based service so that users can tag
> > articles with a location (the place where the article took place), and
> > search (or list) articles by location.
> >
> > This raises some questions:
> >
> > - Presumably best practice is to allow the user not to type free-form
> > locations, but to help them pick a location from a list?
> >
> > - Are there any frameworks that handle geographical hierarchies? For
> > example, an article may be tagged with a city name, and a user may want
> > to list all articles for a county, we'd need to know all of the cities
> > in each county or we'd return nothing.
> >
> > The simplest thing may be to just have a flat list of places, with no
> > hierarchy, a list of cities and major towns for example?
> >
> > Any broad advice on what's out there to provide any
> > geographical/location services would be much appreciated!
> >
> > Thanks!
> > --
> > Posted viahttp://www.ruby-forum.com/.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to