Giter Site home page Giter Site logo

geolocation-and-search's Introduction

Training ROR

data data data

Let's use location data, display them and search trought them !

You can set proxys and caching here

rails generate geocoder:config

Bulk update

rake geocode:all CLASS=Transaction SLEEP=0.25 BATCH=100

Neat example: reverse geocoding to get location of phone

reverse_geocoded_by :latitude, :longitude do |obj,results|
  if geo = results.first
    obj.city    = geo.city
    obj.zipcode = geo.postal_code
    obj.country = geo.country_code
  end
end
after_validation :reverse_geoc

Get within a box

sw_corner = [40.71, 100.23]
ne_corner = [36.12, 88.65]
Venue.within_bounding_box(sw_corner, ne_corner)

we used searchkick to quey into our elastic search instance: (don't forget to increase ram for docker in mac)

docker-compose up

to index:

Model.reindex
# and it does the work

searchkick really does more than a simple client for elastic search, it makes query easy.

FROM

Chris GoRails videos :: Geocoding, Geolocation and Search with Geocoder + Google Maps APIs How to use Google Maps and Markers

About me

Hey there !
I'm letItCurl, fullstack developer engineer in freelance
If you have any question you can contact me if you wish !

I'm always ready to help !

Email me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.