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

'distance' field gets dropped when using Geokit with acts_as_mappable :through

We know that the distance field gets dropped when using the Geokit gem in Rails with acts_as_mappable :through model class. I wonder if there's a way to work around this to get the distance field back. I tried to follow the monkey-patching example…
Anand Iyer
  • 701
  • 5
  • 10
1
vote
1 answer

Get bounding box from array of points

I have a Rails 5 API only project. I have nodes that have latitude/longitude details stored on them. I am using the Rails Geokit gem to do some of the other geographic work. I want to return to the consuming client the bounding box that contains…
1
vote
1 answer

ArgumentError: Unknown key: origin using geokit-rails

I have a rails 4 app where I am trying to find all applications within N number of miles. Based on geokit-rails documention HERE I should be able to do: SapApplication.find(:all, :origin=>'100 Spear st, San Francisco, CA', :within=>10) When I try…
Mark Locklear
  • 5,044
  • 1
  • 51
  • 81
1
vote
1 answer

Ruby On Rails Geokit gem geocoding returning nil

I am struggling with using the geokit gem in a Ruby on Rails application when supplied with an address to return anything other than nil. I've read the previous articles here on Stack Overflow, the GitHub repo for the gem and other internet articles…
birdie697
  • 11
  • 2
1
vote
1 answer

GeoKit API response is unreliable, Gives different responses every time for same payload

GeoKit gem version: 1.11.0 Payload: "3880 S El Camino Real, San Mateo, CA 94402, USA" Api call: Geokit::Geocoders::MultiGeocoder.geocode(payload) Response 1: "Provider: Google, Street: 3880 S El Camino Real.., Success: true" Response 2: "An error…
1
vote
1 answer

Does Geokit use a default google API key?

I'm trying to debug a "too many queries" error I'm getting in my rails app. It appears that the rate limit is being surpassed. I'm trying to locate where the app is providing a Google Geocoding service API key but I don't see it anywhere. I…
Murcielago
  • 1,030
  • 1
  • 14
  • 24
1
vote
1 answer

Assigning a polymorphic acts_as_mappable model in the Rails console

I have a polymorphic Location model: class Location < ActiveRecord::Base acts_as_mappable before_validation :geocode_address, :on => :create belongs_to :locatable, :polymorphic => true end And a User model that references it: class User <…
craig
  • 25,664
  • 27
  • 119
  • 205
1
vote
2 answers

cannot use geokit or Geocoder inside property_web_builder engine

I was customizing the property_web_builder engine for getting nearby results using Geokit or Geocoder gem, but can't use any of it. getting undefined method 'gecoded_by' using 'Geocoder' gem and undefined method 'acts_as_mappable' for 'geokit-rails'…
1
vote
0 answers

Geokit first time finds the address and when we ran this again it will not find the address

I m using a geokit and geokit-rails gem. when i m finding the address it give me below warning. An error has occurred during geocoding: Geokit::TooManyQueriesError Geokit::Geocoders::MultiGeocoder.geocode( "Flagler Beach, FL, US"). Tried this on…
Ajinath Jedhe
  • 152
  • 2
  • 15
1
vote
3 answers

Reverse query a location in Rails-Geocoder with max distance attribute

For an example, I have a model like this class Place < ActiveRecord::Base # has a "latitude" & "longitude" field # notice it has "max_distance" field (meter), will be different on each record end How can I achieve a query that given a…
dkiswanto
  • 192
  • 1
  • 2
  • 12
1
vote
2 answers

Calculating the distance between 2 latitude and longitude locations in a rails project

I am using the geokit-rails gem to calculate the distance between 2 objets which contain latitude and longitude fields: https://github.com/geokit/geokit-rails I have a Leg object - which contains both 1 Origin object and 1 Destination…
RenegadeAndy
  • 5,440
  • 18
  • 70
  • 130
1
vote
1 answer

Rails 5 IntegrationTest with IP Geolocation

I'm making use of the geokit-rails gem to perform geolocation based on the IP address of the user who is logging in via #geocode_ip_address (https://github.com/geokit/geokit-rails#ip-geocoding-helper). However, I'm having a very hard time finding a…
1
vote
1 answer

ERROR -- : Caught an error during Google geocoding call: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A

I am trying to get the address when inputting coordinates like so in my model. def full_address Geocoder.address("#{self.latlon.x}, #{self.latlon.y}") end However, sometimes it works perfectly fine and then sometimes i get this error. I've…
user6500179
  • 149
  • 1
  • 2
  • 12
1
vote
2 answers

What is the best way to show location in Rails 4 app?

I'm building an app for a client. The client want to be able to display street map with its location on the contact page. I've never used maps in a web app before and I've been googling around. there are so many options to use and I´m not sure…
1
vote
1 answer

Which post code is the nearest with Geokit?

I'm using geokit to give me distances between two post codes. I need to determine which post code is the nearest. point_a = Geokit::Geocoders::GoogleGeocoder.geocode "se18 7hp" alpha = ["cr0 3rl", "W2 1AA"] miles = alpha.map do |m|…
Sylar
  • 11,422
  • 25
  • 93
  • 166