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
企業の現実世界をグラフで写し取る
sansantech
PRO
0
240
[2026 Oracle Technical Deep Dive] エンタープライズAIエージェントを支えるOCIソリューション。ラインナップと特徴を理解しよう! (2026年9月17日開催)
oracle4engineer
PRO
0
260
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
410
サーバーフルコンピューティング?AWS Lambda
iwatatomoya
0
130
【Findyテック文化祭ワークショップ】新卒エンジニア&採用担当と作る、 なりたい姿と今やるべき一歩
dip_tech
PRO
0
150
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
190
AIに攻撃される前に、AIに攻撃させる
tsuchikazu
0
110
スキルを作る、その前に!複数人で使われるスキルを 作るためのプロセス
junkifurukawa
2
180
React Nativeでの OTA Updateって、 どう説明する?
ichiki1023
0
140
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
300
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
360
インバスケット試験対策アプリを 作って見えたAIエージェント構築 ナレッジ2選
shichijoyuhi
1
110
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
A Tale of Four Properties
chriscoyier
163
24k
Practical Orchestrator
shlominoach
192
12k
Typedesign – Prime Four
hannesfritz
42
3.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Why Our Code Smells
bkeepers
PRO
340
58k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Making the Leap to Tech Lead
cromwellryan
135
10k
We Have a Design System, Now What?
morganepeng
55
8.3k
Rails Girls Zürich Keynote
gr2m
96
14k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
900
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
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?