Well the problem is that GEOKIT (a ruby gem to work with maps) when using it with Google Map for example returns results in ascii, like:
Svobody prosp 34, Moskva, Rossia
Svobody prosp 35, Moskva, Rossia
Svobody prosp 36, Moskva, Rossia
This happens if either I type query in utf8 or ascii. But I want it to return utf8 results like her...
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 combine two sets of criteria in array format:
I have a default condition:
conditions = [...
Hello all,
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 from this?
Is there a better way to GeoCode IPs in Rails?
...
Hi,
I am using the geokit gem and plugin with rails 3. It seems there is a known issue with them, which can be seen here http://github.com/andre/geokit-rails/issues#issue/15
Now, I tried to follow the solution provided at the bottom. I pasted that function definition, at the end of the file, just above acts_as_mapable, and just after t...
Hi there,
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:
UTF-8 and ASCII-8BIT
The Trace is like this:
1) Spot Basic Validations s...
I added some caching functionality to the geokit gem and used gemcutter to create a copy 'badnaam-geokit'. The only changed are in Geocoders.rb which works fine if I just modify it locally.
However, after I published it to rubygems and installed it and require it as 'badnaam-geokit' in my environment.rb (config.gem "badnaam-geokit") fi...
I come across a small issue in my app. I'm currently using geokit to find objects near a given location, and I use the sort_by_distance_from on the found set.
See below:
@find = Item.find(:all, :origin =>[self.geocode.lat.to_f,self.geocode.lng.to_f], :within=>50, :include=>[:programs], :conditions=>["programs.name = ?", self.name])
...
Iam using geokit-rails (http://github.com/jlecour/geokit-rails branch gem).
I like to build a scope like
a = MyModel.scoped
a = a.limit(10).scoped
a = a.find_within(10,:origin => [mylat,mylng]).scoped
a = a.where(:visible => true)
a = a.paginate(:page => @params[:page], :per_page => 20)
But this does't work - after find the query will...
I've been using the geokit and geokit-rails gem for rails for awhile but one question I haven't found answered is how to find the calculated aggregate center for a collection of points. I know how to calculate the distance between two points, but not more than 2.
My reason is, I have a series of points all in the same city... all thing...
I have this in my shop.rb:
def geocode_address
if !address_geo.blank?
geo=Geokit::Geocoders::MultiGeocoder.geocode(address_geo)
errors.add(:address, "Could not Geocode address") if !geo.success
self.lat, self.lng = geo.lat,geo.lng if geo.success
end
end
# Checks whether this object has been geocoded or not. Returns the ...