SlideShare a Scribd company logo
Geo/Spatial Search with MySQL Alexander Rubin Senior Consultant, MySQL AB
Why Geo Search? ,[object Object],[object Object],[object Object],[object Object]
POI Search Example
Common Tasks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Latitude Longitude Hotel Name
Latitudes and Longitudes
Distance between 2 points The Haversine Formula For two points on a sphere (of radius R) with latitudes φ1 and φ2, latitude separation Δφ = φ1 − φ2, and longitude separation Δλ the distance d between the two points:
The Haversine Formula in MySQL ,[object Object],[object Object],[object Object],[object Object],angles need to be in radians
MySQL Query: Find Nearby Hotels ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Lat can be negative!
Find Nearby Hotels: Results ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MySQL Explain query ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to speed up the query ,[object Object],[object Object],10 Miles
How to calculate needed coordinates ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modify the query ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Stored procedure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Stored Procedure, Contd ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Speed comparison ,[object Object],[object Object],[object Object],[object Object],[object Object]
Stored Procedure: Explain Plan ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geo Search with Sphinx ,[object Object],[object Object],[object Object],[object Object]
Speed comparison of all solutions
Different Type of Coordinates ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Converting between coordinates ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geo Search with Full Text search ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geo Search with Full Text search: example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geo Search with Full Text search: Explain ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DEMO ,[object Object],[object Object],[object Object],[object Object]
Using MySQL Spatial Extension ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Zipcode with Spatial Extension ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spatial Search: Distance ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spatial Search Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Servo systems-integral-state-feedback-lecture-2020
Servo systems-integral-state-feedback-lecture-2020Servo systems-integral-state-feedback-lecture-2020
Servo systems-integral-state-feedback-lecture-2020cairo university
 
Bab 2
Bab 2Bab 2
Bab 2Zinoa
 
Hyperbola as an-example-learning-shifts-on-internet
Hyperbola as an-example-learning-shifts-on-internetHyperbola as an-example-learning-shifts-on-internet
Hyperbola as an-example-learning-shifts-on-internetDanut Dragoi
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABCOMSATS Abbottabad
 
Script clases ide bd espacial
Script clases ide   bd espacialScript clases ide   bd espacial
Script clases ide bd espacialfulllcreeed
 
Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06Aritra Sarkar
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemCOMSATS Abbottabad
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic EncryptionVictor Pereira
 
Measures of Variability Part 2
Measures of Variability Part 2Measures of Variability Part 2
Measures of Variability Part 2James Bausa
 
Compte rendu com op touati
Compte rendu com op touatiCompte rendu com op touati
Compte rendu com op touatihamdinho
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
zen and the art of SQL optimization
zen and the art of SQL optimizationzen and the art of SQL optimization
zen and the art of SQL optimizationKaren Morton
 

What's hot (19)

Servo systems-integral-state-feedback-lecture-2020
Servo systems-integral-state-feedback-lecture-2020Servo systems-integral-state-feedback-lecture-2020
Servo systems-integral-state-feedback-lecture-2020
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
 
Bab 2
Bab 2Bab 2
Bab 2
 
Hyperbola as an-example-learning-shifts-on-internet
Hyperbola as an-example-learning-shifts-on-internetHyperbola as an-example-learning-shifts-on-internet
Hyperbola as an-example-learning-shifts-on-internet
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
BCS
BCSBCS
BCS
 
Script clases ide bd espacial
Script clases ide   bd espacialScript clases ide   bd espacial
Script clases ide bd espacial
 
Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06Fractal Rendering in Developer C++ - 2012-11-06
Fractal Rendering in Developer C++ - 2012-11-06
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
 
Img 0008
Img 0008Img 0008
Img 0008
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
 
Alg2 lesson 6-1
Alg2 lesson 6-1Alg2 lesson 6-1
Alg2 lesson 6-1
 
Measures of Variability Part 2
Measures of Variability Part 2Measures of Variability Part 2
Measures of Variability Part 2
 
Python hmm
Python hmmPython hmm
Python hmm
 
Compte rendu com op touati
Compte rendu com op touatiCompte rendu com op touati
Compte rendu com op touati
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAM
 
Py3k
Py3kPy3k
Py3k
 
Solr 3.1 and beyond
Solr 3.1 and beyondSolr 3.1 and beyond
Solr 3.1 and beyond
 
zen and the art of SQL optimization
zen and the art of SQL optimizationzen and the art of SQL optimization
zen and the art of SQL optimization
 

Similar to Sample document

Geolocation on Rails
Geolocation on RailsGeolocation on Rails
Geolocation on Railsnebirhos
 
R getting spatial
R getting spatialR getting spatial
R getting spatialFAO
 
Geopy module in python
Geopy module in pythonGeopy module in python
Geopy module in pythonAshmita Dhakal
 
10. Getting Spatial
10. Getting Spatial10. Getting Spatial
10. Getting SpatialFAO
 
OSCON july 2011
OSCON july 2011OSCON july 2011
OSCON july 2011chelm
 
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docxCalculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docxssuserd02b23
 
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docxCalculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docxssuserd02b23
 
Stratio's Cassandra Lucene index: Geospatial use cases by Andrés Peña
Stratio's Cassandra Lucene index: Geospatial use cases by Andrés PeñaStratio's Cassandra Lucene index: Geospatial use cases by Andrés Peña
Stratio's Cassandra Lucene index: Geospatial use cases by Andrés PeñaBig Data Spain
 
Das Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based ServicesDas Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based ServicesStephan Schmidt
 
Geo search introduction
Geo search introductionGeo search introduction
Geo search introductionkenshin03
 
Stratio's Cassandra Lucene index: Geospatial use cases
Stratio's Cassandra Lucene index: Geospatial use casesStratio's Cassandra Lucene index: Geospatial use cases
Stratio's Cassandra Lucene index: Geospatial use casesAndrés de la Peña
 
Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...
Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...
Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...DataStax
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)Flor Ian
 
R Spatial Analysis using SP
R Spatial Analysis using SPR Spatial Analysis using SP
R Spatial Analysis using SPtjagger
 
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial WorldGIS in the Rockies
 

Similar to Sample document (20)

Geolocation
GeolocationGeolocation
Geolocation
 
Geolocation on Rails
Geolocation on RailsGeolocation on Rails
Geolocation on Rails
 
10. R getting spatial
10.  R getting spatial10.  R getting spatial
10. R getting spatial
 
R getting spatial
R getting spatialR getting spatial
R getting spatial
 
Geopy module in python
Geopy module in pythonGeopy module in python
Geopy module in python
 
10. Getting Spatial
10. Getting Spatial10. Getting Spatial
10. Getting Spatial
 
Npc14
Npc14Npc14
Npc14
 
OSCON july 2011
OSCON july 2011OSCON july 2011
OSCON july 2011
 
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docxCalculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docx
 
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docxCalculate_distance_and_bearing_between Latitude_Longitude_Points.docx
Calculate_distance_and_bearing_between Latitude_Longitude_Points.docx
 
Stratio's Cassandra Lucene index: Geospatial use cases by Andrés Peña
Stratio's Cassandra Lucene index: Geospatial use cases by Andrés PeñaStratio's Cassandra Lucene index: Geospatial use cases by Andrés Peña
Stratio's Cassandra Lucene index: Geospatial use cases by Andrés Peña
 
Jan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoopJan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoop
 
Day 6 - PostGIS
Day 6 - PostGISDay 6 - PostGIS
Day 6 - PostGIS
 
Das Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based ServicesDas Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based Services
 
Geo search introduction
Geo search introductionGeo search introduction
Geo search introduction
 
Stratio's Cassandra Lucene index: Geospatial use cases
Stratio's Cassandra Lucene index: Geospatial use casesStratio's Cassandra Lucene index: Geospatial use cases
Stratio's Cassandra Lucene index: Geospatial use cases
 
Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...
Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...
Stratio's Cassandra Lucene index: Geospatial Use Cases (Andrés de la Peña & J...
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)
 
R Spatial Analysis using SP
R Spatial Analysis using SPR Spatial Analysis using SP
R Spatial Analysis using SP
 
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
 

More from arunsethu87 (20)

sample videos
sample videossample videos
sample videos
 
test doc
test doctest doc
test doc
 
Test Doc
Test DocTest Doc
Test Doc
 
test
testtest
test
 
color code
color codecolor code
color code
 
test
testtest
test
 
test
testtest
test
 
sample file
sample filesample file
sample file
 
text file
text filetext file
text file
 
text fiels
text fielstext fiels
text fiels
 
test
test test
test
 
sample text file
sample text filesample text file
sample text file
 
Test Doc
Test DocTest Doc
Test Doc
 
document file
document filedocument file
document file
 
test
testtest
test
 
t
tt
t
 
t
tt
t
 
test doc
test doc test doc
test doc
 
test doc
test doctest doc
test doc
 
Test PDF
Test PDFTest PDF
Test PDF
 

Sample document

Editor's Notes

  1. ADD EXPLAIN PLAN
  2. ADD EXPLAIN PLAN