I have added a few features and made a few bug fixes to GeoKit. These are as follows:
- [FEATURE] Added timeout support for geocoder web service calls
- [FEATURE] Added proxy support for geocoder web service calls
- [FEATURE] Added support for SQL count queries — they work like the finders
- [BUG FIX] Fixed range finders to support exclusive ranges
- [BUG FIX] Fixed configuration to use class accessors instead of constants (that were being reinitialized)
- [BUG FIX] Eliminated bogus IP address returned from IP geocoder when the request IP is 127.0.0.1
- [BUG FIX] Fixed GeoLoc’s hash method and added an alias to_hash
- [REFACTOR] Require statements to be cleaner all the way around
Thanks to the following who reported bugs that got fixed or who submitted patches that were used in part or in their entirety:
- Norbert Crombach
- Justin French
- Hoan Ton-That
- Jason Seifer
Thanks to everyone for your feedback, patches, and compliments. If I didn’t name you explicitly, it means that your thanks by name will come later.
Since I am in a GeoKit development mode right now, let me or Andre know if there are other features, bug fixes, or patches I should be aware of. I know that we had been planning to modify our configuration approach to be compatible with YM4R, but that’s been delayed indefinitely. They use a YAML file and we use the environment configs — and there really wasn’t a compelling reason to mess with it. Also, no UK geocoding yet — didn’t receive too much demand.
Please review the README for updates and take a look at the new environment config template under the plugin’s assets directory to see how you should config GeoKit. And by all means, let me know if there are issues that I’ve inadvertently created for you.
Great to hear. GeoKit is an amazing tool. Do these changes comprise an upcoming release?
Howdy Bill,
I’m having some issues using geokit with the will_paginate plugin (pagination is being yanked out of rails 2.0) Do you have any suggestions on how to get geokit to play nice with pagination calls? Currently, with will_paginate, I get an Unknown key(s): origin when doing my finds.
@places = Address.paginate :per_page => 10,
:page => params[:page],
:include => [:place],
:conditions =>['distance
Hey There,
I will have to look at it in more detail. I quickly inspected the Will Paginate code and on the surface, it seemed like it was playing with the finder options just like we are in GeoKit. In both cases, we add options to the finder, use them, and then strip them out seamlessly. I’ll have to create a test case to follow it exactly.
Bill
Hi Bill,
Thanks very much. FWIW, I opened a ticket on it a few minutes ago: http://err.lighthouseapp.com/projects/466/tickets/59-will_paginate-doesn-t-play-nicely-with-geokit
-Vince
First just FYI per last comment, I am using the latest GeoKit successfully with the latest will_paginate.
Also I want to make sure to say: I LOVE THIS PLUGIN! So a huge thank you.
Since you asked for input, the big problem for me is that eager loading (:include) doesn’t work. This is already talked about here:
http://jystewart.net/process/2007/03/select-and-include-in-activerecord-queries/
I’m a bit stumped how to get around the problem without going from one database query to possibly hundreds (and even then not very well). I think I might have to add duplicate lat/lng data to the model that my mappable model has_many of. However with my data I will get dupe parents, so I’ll need to select distinct (if that works with GeoKit) or just filter dupes on the app layer. Kind of a bummer about the dupe lat/lng data though (DRY).
Anyway, seems like a tricky problem. I’m trying to avoid monkey-patching Rails…
Are you using PostgreSQL geometry functions if those are available?
Like I have a method in my cities model that finds by radius, and is using PostgreSQL for that. See here : http://pastie.caboo.se/pastes/101087
Nope, not using those functions. We are using primitive trig functions that are common to both MySQL and Postres.
Just starting on a site using GeoKit and I noticed an “oddity” about an address.. When using the Google Maps web site I get one set of Long/Lat but using GeoKit (thru Google Maps) I get a different set (slightly off by about 1/4 mile). For instance google gives: -71.119759 while Geokit gives: -71.124938
Here’s my code:
results = Geocoding::get(params[:searchField])
if results.status == Geocoding::GEO_SUCCESS
coord = results[0].latlon
RAILS_DEFAULT_LOGGER.error(coord);
(email me and I’ll send more details)
Thanks,
Gary
PS. Complete RoR newbie.. So could easily be my mistake.
My guess is that Google Maps does not geocode exactly the same as the Google Geocoder. I haven’t heard any similar complaints, so I wouldn’t be too worried.
Do you plan to expose the status codes returned by Google, such as 620 (too many queries) so developers can throttle requests accordingly?
Pingback: john bachir