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
0
votes
1 answer

Geokit not working with geocoder.us and google api

My Geokit plugin was working fine but after geocoder.us down it stops working and showing error. Geokit::Geocoders::GeocodeError. Now How can I disable geocoder.us service and use only geocoder.ca and google services. Here's my code: if defined?…
0
votes
5 answers

Geokit Gem 1.5 and Ruby 1.9.2 => "incompatible character encodings: UTF-8 and ASCII-8BIT"

I am currently writing a rails app using bleeding edge stuff. Rails3, rSpec2, Ruby 1.9.2 and Geokit 1.5.0. When i try to geocode addresses that have special characters that are not in ASCII-8Bit i get this error: incompatible character encodings: …
nocksock
  • 5,369
  • 6
  • 38
  • 63
0
votes
1 answer

Ruby on Rails | Get all areas, cities, countries in the world

How could I possibly get a list of all areas, cities,states, countries in the world like Zomato has. Is there any Gem that can help me. I have searched for few GEMS (django-cities, WorldCityLocations) which gives only till cities and not the…
Vicky
  • 151
  • 1
  • 10
0
votes
1 answer

Trying to display content on side bar based on the visitors location

I am trying to display a list of salons that correspond to the users location on the show view of treatment. The two tables don't have a direct relationship. I have installed the geokit gem and now I am trying to work out if I need to add additional…
0
votes
1 answer

RoR: How to get lat and lng using geokit-rails

I want to display a google maps centered at the user's location. I am willing to use gmaps4rails and geokit-rails gems, because I guess those are the best ones. What I have so far is the map initialization:
pablito.aven
  • 1,135
  • 1
  • 11
  • 29
0
votes
1 answer

If geokit-rails no longer has geo_scope method, what I am supposed to use to get lat/long of an address

Looking at the latest release of geokit-rails (2.1.0), it looks like they have removed the method geo_scope (https://github.com/geokit/geokit-rails/commit/781c4dc62d3b044196efbfad269d4780e6afbe6b). However, the README on the github account still…
Gibby
  • 1
  • 2
0
votes
1 answer

Setup a testdirectory for a Rails Plugin

I started to create a rails plugin which includes some class and instance methods of Controller and Model. I fist tried to setup the tests for the Model. Add a models directory in my test dir. But i noticed - i need the geokit-rails plugin for my…
0
votes
1 answer

Database layout for an application with geocoding features using geokit

I'm developing a real estate web catalogue and want to geocode every ad using geokit gem. My question is what would be the best database layout from the performance point if i want to make search by country, city of the selected country,…
vooD
  • 2,881
  • 2
  • 25
  • 34
0
votes
1 answer

Will_paginate and geokit misbehavior (double query)

I'm using will_paginate to paginate my geokit search results. The code works, however, when looking at the log it does double the geokit query when using the following will_paginate call: @posts = Post.paginate :page => params[:page], :per_page =>…
slythic
  • 311
  • 4
  • 15
0
votes
1 answer

Rails: Geokit incorrectly converting IPv4 address to latitude and longitude

I want to convert two IPv4 addresses to latitude and longitude, then calculate the geographical distance between them. Geokit says it can do this. Seattle: a = Geokit::Geocoders::GoogleGeocoder.geocode("207.244.147.34") a.lat => 37.0483944, a.lng =>…
gr8scott06
  • 903
  • 1
  • 11
  • 20
0
votes
2 answers

How to use Geokit on a rails project

I am using Rails 4.2.0 and Ruby 2.2.0. I want to use geokit to convert an address to latitude and longitude. I already did gem install geokit in my terminal. I also included gem 'geokit' in my Gemfile, and run bundle install. On a controller, I try…
saraf
  • 94
  • 12
0
votes
1 answer

Error while using Geokit-Rails in model instance method

I am trying to use geokit-rails' .within helper method in a model instance method. Take a look here: def self.crunch users = User.all users.each do |user| last_movement = Movement.where(user_id: user.id).try(:last) …
Arun
  • 626
  • 10
  • 29
0
votes
1 answer

Using Geokit to return closest record returns PG::SyntaxError

I'm using Geokit to find the closest station to a location. The code runs after validation. Here's the Location model: class Location < ActiveRecord::Base belongs_to :station # Find nearest station after validation after_validation…
0
votes
1 answer

Geokit distance calculation oddity

I'm using the Geokit plugin to calculate the distance between the current_user and other users (geocoding actually stored in Profile model). For testing purpose, I created two Users, one in Minneapolis, MN and one in St. Paul, MN. I used the Geokit…
craig
  • 25,664
  • 27
  • 119
  • 205
0
votes
1 answer

Searching Post by Origin & Destination locations using Geokit-Rails

Ok what i have is a Trucking Load board where Truckers come to post there available Trucks. I have the Trucks posting. But am having issues setting up the search functions and the way i need to associate different tables. Rails 3 postgres gem…
Big Al Ruby Newbie
  • 834
  • 1
  • 10
  • 30