23
Planning Your Location Strategy for Rails

Planning Your Location Strategy for Rails

Embed Size (px)

DESCRIPTION

What does geolocation mean? How about geocoding? Reverse-coding? Geospatial? Is Google Maps' JavaScript API the best service to use? How do we avoid being rate limited? Should we import a free geographical dataset to make local SQL queries upon it? When do we move from Postgres and the Geocoder gem in Rails to PostGIS? Integrating location into your Rails app brings up a number of questions. This slide deck is intended to answer some of the basic ones and help you plan your location strategy. To go deeper, we have a full codebase (with tests) available at: https://learn.thoughtbot.com/geocoding-on-rails

Citation preview

Page 1: Planning Your Location Strategy for Rails

Planning Your Location Strategy for Rails

Page 2: Planning Your Location Strategy for Rails

-- C. Goldoni

“The world is a beautiful book, but it’s not much use if you don’t know how to read.”

https://learn.thoughtbot.com/geocoding-on-rails

Page 3: Planning Your Location Strategy for Rails

I want to see places to stay in an interesting neighborhood.

https://learn.thoughtbot.com/geocoding-on-rails

Page 4: Planning Your Location Strategy for Rails
Page 5: Planning Your Location Strategy for Rails

I want to find hotels near public transportation.

https://learn.thoughtbot.com/geocoding-on-rails

Page 6: Planning Your Location Strategy for Rails
Page 7: Planning Your Location Strategy for Rails

How do we go from desired user outcomes to working software?

• Learn the vocabulary

• Know the responsibilities of each part of the tech stack

• Form a strategy

• Code!

https://learn.thoughtbot.com/geocoding-on-rails

Page 8: Planning Your Location Strategy for Rails

Geolocation

n. The process of identifying the geographical location of a person or device by digital means.

https://learn.thoughtbot.com/geocoding-on-rails

Page 9: Planning Your Location Strategy for Rails

Geocoding

v. The process of obtaining geographic coordinates (latitude and longitude) from full or partial address information.

https://learn.thoughtbot.com/geocoding-on-rails

Page 10: Planning Your Location Strategy for Rails

Reverse-geocoding

v. The process of obtaining address information from geographic coordinates (latitude and longitude).

https://learn.thoughtbot.com/geocoding-on-rails

Page 11: Planning Your Location Strategy for Rails

Geospatial

adj. Of or relating to the relative position of things on the earth’s surface.

https://learn.thoughtbot.com/geocoding-on-rails

Page 13: Planning Your Location Strategy for Rails

https://learn.thoughtbot.com/geocoding-on-rails

Server-side (Ruby)

Interacts with external geocoding services and queries the database.

Page 14: Planning Your Location Strategy for Rails

https://learn.thoughtbot.com/geocoding-on-rails

Database (SQL)

Persists geocoded data, available for geospatial queries.

Page 15: Planning Your Location Strategy for Rails

https://learn.thoughtbot.com/geocoding-on-rails

Client-side (JavaScript)

Interacts with external geocoding services.

Page 16: Planning Your Location Strategy for Rails

https://learn.thoughtbot.com/geocoding-on-rails

External service

Geocodes address, reverse-geocodes coordinates, draws map.

Page 17: Planning Your Location Strategy for Rails

Know our data

• Are the records already geocoded?

• Do our records have address information?

• How accurate do we need the geographic information to be?

https://learn.thoughtbot.com/geocoding-on-rails

Page 18: Planning Your Location Strategy for Rails

Choose an external geocoding service

• How many requests per day will we be making? Will we get rate limited?

• What are the comparable benefits of free, paid, and open source services?

• What is our budget?

https://learn.thoughtbot.com/geocoding-on-rails

Page 20: Planning Your Location Strategy for Rails

Whiteboard our design

• Importing data

• Client-side responsibilities

• Server-side responsibilities

https://learn.thoughtbot.com/geocoding-on-rails

Page 21: Planning Your Location Strategy for Rails

Testing

• Stub requests to external services

• Create a fake

https://learn.thoughtbot.com/geocoding-on-rails

Page 22: Planning Your Location Strategy for Rails

https://learn.thoughtbot.com/geocoding-on-rails

Details in the book

Includes a complete codebase (with tests). Plot points on a map, use HTML5 to get coordinates in the browser, cache external services, index geospatial queries, and more.