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
1
vote
1 answer

Why does Google's Geolocation API think that localhost is in Iraq?

Using the geokit gem in irb: >> Geokit::Geocoders::secure = false => false >> Geokit::Geocoders::MultiGeocoder.geocode("::1").full_address => "1, Madain, Iraq" What the...?
Jason Galuten
  • 1,042
  • 2
  • 11
  • 20
1
vote
1 answer

Geocoding an IP Address in Rails

I have GeoKit setup and in general I'm really happy with it. But I recently tried Geocoding IP Addresses with it and its default results (provided by hostip.info it looks like) don't seem very accurate or complete. Has anyone else had bad results…
Brian Armstrong
  • 19,707
  • 17
  • 115
  • 144
1
vote
0 answers

geokit-rails patched ActiveRecord find method

Rails 4.1.12 ruby 2.1.0 restaurant.rb class Restaurant < ActiveRecord::Base ... acts_as_mappable :through => :address ... end So when I try Restaurant.find(1) the exception raised. 2.1.0 :001 > Restaurant.find(1) Restaurant Load (12.4ms) …
Lesha Pipiev
  • 3,251
  • 4
  • 31
  • 65
1
vote
1 answer

Convert a complex Sql query to Rails

I am using gem geokit rails in my app. I have a table that contains various addresses. I am trying to use the geokit feature by_distance which finds records ordered by distance from the origin point. So I am doing this at the moment. @close =…
user1010101
  • 2,062
  • 7
  • 47
  • 76
1
vote
1 answer

Using Geokit and Geocoding to print value

I have a Model Stop as such. class Stop < ActiveRecord::Base geocoded_by :address after_validation :geocode acts_as_mappable defaults_units: :kms, lat_column_name: :latitude, lng_column_name: :longitude My stop table has field…
user1010101
  • 2,062
  • 7
  • 47
  • 76
1
vote
1 answer

Using Geokit-Rails, How can I find all fields within a distance OR have a bit value set to 1

I have a project where users can search for results within a specified distance of their location, e.g. within 10 miles of their postcode. I am using geokit-rails for this and it works great using the simple: .within(@distance, :origin =>…
1
vote
1 answer

Simple Acts_as_mappable "through" not working

Using the geokit-rails gem, I have: Employer.rb model, with lng & lat attributes: has_many :jobs, dependent: :destroy acts_as_mappable Job.rb model, with no lng or lat acts_as_mappable :through => :employer If I try Job.within(3, origin: [0, 0])…
Will Taylor
  • 1,994
  • 2
  • 23
  • 36
1
vote
1 answer

"undefined method `/' for "":String:" Error when implementing geokit

I'm trying to use geokit to find all the entities next to a given set of coordinates, I've been trying for quite a few hours now and can't seem to find what the issue is. Initially thought it would have something to do with the Latitude and…
Manu Matute
  • 373
  • 1
  • 3
  • 12
1
vote
3 answers

Geokit-rails + MySQL: How to speed up search through latitude and longitude?

I have a database table that contains columns storing latitude and longitude coords (both have the decimal data type). The table has about 500k rows through the searches are made. The problem is that if I search rows that are in radius of 100-200…
user984621
  • 46,344
  • 73
  • 224
  • 412
1
vote
1 answer

TypeError: no implicit conversion of Symbol into Integer for search with geokit-rails

I've got the geokit-rails gem installed with geocoder, and have loaded my configuration correctly with the right API keys and settings. I've properly constructed ActiveRecord objects that have encoded lat and lng columns with float values. Now I am…
liamzebedee
  • 14,010
  • 21
  • 72
  • 118
1
vote
1 answer

Gem GeoKit: uninitialized constant GeoKit::Geocoders::Geocoder when trying to initialize my own geocoder

I followed the instructions on installing geokit-rails (v 2.0.1) and geokit (v 1.8.5). Then attempted to create my own geocoder (to be used with tests). Here is the code I use in my config/initializers/fake_geocoder.rb file require 'geokit' module…
Tom H
  • 207
  • 2
  • 13
1
vote
1 answer

Triggering auto geocoding using Geokit

I'm currently working on implementing Geokit into my project. I want to take the info that a user enters onto the create website, geocode the address, and create the entry with the new latitude and longitude created. However, lat or long won't be…
1
vote
1 answer

RoR - Geokit plugin: why Location.find is giving me back an empty array? (Location is a model that "acts_as_mappable")

I have installed both geokit gem and geokit-rails plugin. I configured the plugin as shown here: http://github.com/andre/geokit-rails . Then I generated a new model - Location, which looks like this: class Location < ActiveRecord::Base …
sNiCKY
  • 1,823
  • 3
  • 18
  • 20
1
vote
2 answers

Add distance to a particular latitude/longitude position

Rails 4 + Postgres. New to geospatial. Happy to accept solutions that involve RGeo, Geokit, Geocoder, or any other gem that helps solve this issue. Model contains two fields latitude and longitude. I have an offset attribute that contains a distance…
changingrainbows
  • 2,551
  • 1
  • 28
  • 35
1
vote
1 answer

Geokit failing to return information from address

I'm trying to get the suggested_bounds from an address with GeoKit. This solution has worked, but all of a sudden it's started failing: Geokit::Geocoders::GoogleGeocoder.geocode(location).suggested_bounds That returns nil. When trying it without…
Nathan
  • 1,864
  • 3
  • 18
  • 22