Questions tagged [geokit]

A Ruby on Rails gem that provides geocoding and distance calculations.

Geokit is a Rails gem that provides geocoding and distance calculations.

It provides various geocoding and geolocation options, including:

  • Distance calculations between two geographical points
  • Check whether a certain point is within certain rectangular bounds
  • Support of multiple geocoding data providers - Google, Yahoo and others
141 questions
2
votes
1 answer

Rails Heroku SocketError: getaddrinfo: Name or service not known

I am on a heroku app, Ruby 2.2.0, Rails 4.0.12 and using the geokit-rails gem. When I do a IpGeocoder.geocode(request.remote_ip) I get the error: Caught an error during Ip geocoding call: getaddrinfo: Name or service not known I searched online…
user2911232
2
votes
2 answers

Combine arrays of conditions in Rails

I'm using the Rails3 beta, will_paginate gem, and the geokit gem & plugin. As the geokit-rails plugin, doesn't seem to support Rails3 scopes (including the :origin symbol is the issue), I need to use the .find syntax. In lieu of scopes, I need to…
craig
  • 25,664
  • 27
  • 119
  • 205
2
votes
2 answers

Geokit Rails: no implicit conversion of Symbol into Integer

I'm getting an error that happens for one model and not the other. I can run Job.all.within(5, :origin => [0, 0]), but not User.all.within(5, :origin => [0, 0]), even though they have the same info in their models: acts_as_mappable lng_column_name:…
Will Taylor
  • 1,994
  • 2
  • 23
  • 36
2
votes
2 answers

How to Setup Geokit with Google geocoder: client_id and cryptographic_key

I have been trying at for a couple hours to get geocoder to work with google. I more or less am trying to figure out how to configure my google account and the code below to make geocoder work Geokit::Geocoders::GoogleGeocoder.client_id =…
2
votes
1 answer

Geokit - `block (2 levels) in ': undefined method

I'm migration a Rails 2.3.8 app to Rails 3.0.20 so I went from using "gem 'geokit' 1.6.0" to "gem "geokit-rails". I get: /Users/alextoul/.rvm/gems/ruby-1.9.3-p484@rails3/gems/geokit-rails-2.0.1/lib/geokit-rails/railtie.rb:33:in `block (2 levels) in…
Alextoul
  • 839
  • 3
  • 9
  • 19
2
votes
2 answers

Geokit in Ruby on Rails, problem with acts_as_mappable

i have looked through the list of related questions however my problem does not seem to be listed and hence here it is: Basically I'm trying to use Geokit within the Ruby on Rails environment, im not sure if i installed it properly, I have included…
Erika
  • 2,045
  • 7
  • 25
  • 31
2
votes
0 answers

Was Geocoder successful?

Geokit has the helpful functionality: g = Geokit::Geocoders::GoogleGeocoder.geocode [address_1, address_2, city, zip_code, state, country].compact.join(', ') if g.success == true ... Can the Geocoder gem return a true somehow if Google…
sscirrus
  • 55,407
  • 41
  • 135
  • 228
2
votes
2 answers

Find locations in radius of path between 2 other locations

I have a large database of locations, all with lat/long. I use GeoKit and Rails to trivially get locations within a set radius of any other location. All that works great. My goal is to specify 2 locations (say, A and B), and find all other…
RealCasually
  • 3,593
  • 3
  • 27
  • 34
2
votes
2 answers

Floating point calculations with latitudes and longitudes of varying precisions

Background: I receive a long and lat as parameters to a web service. They are typically up to 6 decimal places. When a new request is received, I calculate the distance between the last recorded loc and the long/lat in the params of the request. If…
cakeforcerberus
  • 4,657
  • 6
  • 32
  • 42
2
votes
3 answers

Geokit and Authlogic, geocoding the users ip address when they create a user

Has anyone done this? I'm confused at how I can make this work, first off I have my user model Geocoding with it works fine in IRB, just can't figure out how to get it to work in my project. Trying to use some examples from the readme here:…
JP Silvashy
  • 46,977
  • 48
  • 149
  • 227
2
votes
1 answer

Make GeoKit play nicely with my Address class

My Address class has a geocode class method that returns an array of address objects derived from geocoding the method's parameter (if the geocoding results in an exact match, the array will have one element). One annoying part about writing this…
Tom Lehman
  • 85,973
  • 71
  • 200
  • 272
1
vote
2 answers

How to do batch geo-coding in rails 3

I have about 100,000 records, that I need to find latitude and longitude. Currently I am using geokit-rails for geo-coding. What I am doing now is looping the records one by one to find latitude and longitude. But it's very time consuming. Is there…
Amal Kumar S
  • 15,555
  • 19
  • 56
  • 88
1
vote
2 answers

Geokit plus Rails 3.1.1, lat and lon issue.

I am using geokit-rails3 gem to find products in all colleges within range of particular college. A college has_many products and a product belong to college, there is another category model which has_many products and product belongs_to category.…
Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
1
vote
2 answers

geocoding rails

I am trying to geocode multiple addresses in a model using either geokit or geocoder and I can't get either on of the gems to work as I want them to. Here is the code that I am applying to my model for both use cases and the errors I get for each…
tomciopp
  • 2,602
  • 2
  • 31
  • 60
1
vote
1 answer

Rails 3.1.0, geokit, with error acts_as_mappable

I am getting the undefined local variable or method `acts_as_mappable' error when using geokit, and after tons of Goggling and attempts, I cannot seem to be able correct the problem. Basically, I have the following gems installed: geokit (1.6.0,…
Tache
  • 495
  • 3
  • 9
1 2
3
9 10