Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Geolocalização + E-Commerce
Search
Alexandre Gaigalas
June 08, 2016
Technology
180
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Geolocalização + E-Commerce
Apresentação sobre geolocalização realizada no iMasters DevCommerce 2016
Alexandre Gaigalas
June 08, 2016
More Decks by Alexandre Gaigalas
See All by Alexandre Gaigalas
Passos em Direção à Glória do REST
alganet
0
570
Porrada no Wordpress!
alganet
2
450
Microframeworks vs. Frameworks
alganet
4
390
Dados!
alganet
2
320
Domine Validação de Dados em 45min
alganet
6
500
Criação de Software para Durar
alganet
4
570
REST in PaaS
alganet
6
1.2k
Linked Data e Web Semântica
alganet
1
520
Armazenamento de Dados para Web Semântica
alganet
4
410
Other Decks in Technology
See All in Technology
SREの視点で考えるSIEM活用術 〜AWS環境でのセキュリティ強化〜
cscengineer
PRO
0
320
SREへの勘違いに気づいた後の話
tomodakengo
0
150
Why Agent Cost Needs Observability
nttcom
0
150
Harness Engineering on Rails
joelq
0
460
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
630
人間はどの意思決定を手放せるのか
kawasima
15
8.2k
バイブコーディング時代のWebアプリ開発入門~Cloud Runで学ぶセキュアなビルドとデプロイ
waiwai2111
1
150
[Kiro Meetup #7] Kiro Crew Dive Deep
konippi
0
300
品質と信頼性を地続きにする
grimoh
2
1k
あけおめLINE 傾向とその対策
nasa9084
0
320
CLIライブラリ開発を支える技術
htnabe
0
150
AI coding 整合正規方法
philipz
0
550
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
560
YesSQL, Process and Tooling at Scale
rocio
174
15k
Facilitating Awesome Meetings
lara
57
7.1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
590
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
260
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
240
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Transcript
Geolocalização + E-Commerce
Alexandre Gaigalas
Alexandre Gaigalas Iterador de CRUD Avançado
None
Powered by: PHP, MongoDB, MySQL, Redis, Kafka, ActiveMQ, Memcache, Amazon,
Docker, etc.
None
Encontrando Veículos
None
None
<?php $mongo->my_db->command([ 'geoNear' => 'my_collection', 'near' => [ -46.6579243, -23.5640367
], 'maxDistance' => '1' / 6378.1, 'spherical' => true, 'distanceMultiplier' => 6378.1 ]);
<?php $mongo->my_db->ensureIndex([ 'location' => '2d' ]);
None
Tem um jeito melhor?
None
None
Distâncias são relativas
None
None
Easy Share: Compartilhamento de Corridas
None
None
Lembra no colégio...
None
{ "type": "MultiPolygon", "coordinates": [ [ [ [-109.25, 36.285596], [-109.27,
40.962013], [-109.35, 36.285596] ], [ [-59.35, 36.285596], [-59.45, 40.962013], [-59.55, 36.285596] ] ] ] }
<?php $mongo->my_db->ensureIndex([ 'location' => '2dsphere' ]);
None
None
Multi-Pontos e Multi-Polígonos
{ "type": "MultiPoint", "coordinates": [ [-105.01621, 39.57422], [-80.6665134, 35.0539943] ]
}
$mongo->my_db->my_collection->find([ 'location' => [ '$geoWithin' => [ '$geometry' => [
'type' => 'MultiPolygon', 'coordinates' => [ [ [ [-109.25, 36.285596], [-109.27, 40.962013], [-109.35, 36.285596] ], [ [-59.35, 36.285596], [-59.45, 40.962013], [-59.55, 36.285596] ] ] ] ] ] ] ]);
Invertendo tudo...
<?php $mongo->my_db->my_collection->find([ '$and' => [ [ 'location' => [ '$geoIntersects'
=> [ '$geometry' => $pointA ] ] ], [ 'location' => [ '$geoIntersects' => [ '$geometry' => $pointB ] ] ] ] ]);
Obrigado!
Perguntas?