On Wed, Feb 11, 2009 at 15:42, Joaquin Rivera Padron <[email protected]> wrote: > look great on the pixs, I let you know more when I get a time to check the > internals My intention is to get a insoshi test web in my home server, but I have changed my isp, and I haven't got internet at home right now. I hope in a week to change the situation.
> what about model validations, errors on geo data submitted and such? those > would require server-side geolocations The location of the event is optional, so if you don't introduce nothing, the lat and lng will be 0. Right now, when you create an event, you can introduce an address, click "geolocate" and you can see where google maps locate your address in the map (with that, we can obtain the lat and lng of the address), so the validation is what google maps resolves, that in case it can't locate the address will be a javascript alert saying "sorry, we can't geolocate your address". As everybody knows, the geolocation of google maps isn't perfect, so my intention is after inserting the address, the user can move the event point in the map, and we can obtain the new lat and lng. > would be great to have. I see you are only keeping lat and lng, how about > country, city and region? to search for text rather than distance > calculations. That's where geokit plugin enter. We can make a reverse geolocation with the lat and lng, so if we do: Geokit::Geocoders::GoogleGeocoder.reverse_geocode "37.791821,-122.394679" we will obtain: #<Geokit::GeoLoc:0xb760cbd0 @lng=-122.3947666, @country_code="US", @street_address="101 115 Main St", @lat=37.7917521, @precision="address", @zip="94105", @provider="google", @full_address="101-115 Main St, San Francisco, CA 94105, USA", @state="CA", @success=true, @city="San Francisco"> My first step was to save in the DB the lat and lng, but I'm agree with you that will be more interesting to save the full address in the DB after creating the event, and display it anywhere in text mode (maybe as a hidden text, and display it with a slide effect). > If you think its ok, where would you keep those? Make country a Model? use a > country webservice (are there any?) or simply keeping those geo results in > (let's say) english always, then indexing the table for the fields (country, > city) and such.... Geokit plugin has one great option that I must test that is "acts_as_mappable". The idea is the users may insert the location (saved in the database with lat and lng) and doing the events acts_as_mappeable we could do: Event.find(:all, :origin => @user.geolocation, :within => 5) and the result will be all the events in 5 kilometers/milles around where the person lives. Doing that, we don't need to store countries or other things apart the lat, lng and the address. --~--~---------~--~----~------------~-------~--~----~ Insoshi developer site: http://dogfood.insoshi.com/ Insoshi documentation: http://docs.insoshi.com/ You received this message because you are subscribed to the Google Groups "Insoshi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/insoshi?hl=en -~----------~----~----~----~------~----~------~--~---
