Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Geolocalização + E-Commerce
Search
Alexandre Gaigalas
June 08, 2016
Technology
170
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
560
Porrada no Wordpress!
alganet
2
440
Microframeworks vs. Frameworks
alganet
4
380
Dados!
alganet
2
310
Domine Validação de Dados em 45min
alganet
6
490
Criação de Software para Durar
alganet
4
560
REST in PaaS
alganet
6
1.2k
Linked Data e Web Semântica
alganet
1
510
Armazenamento de Dados para Web Semântica
alganet
4
410
Other Decks in Technology
See All in Technology
水を運ぶ人としてのリーダーシップ
izumii19
4
1.1k
From Prompt Engineering to Loop Engineering
shibuiwilliam
1
300
FinOps X 2026 Recap from Engineer Side #JapanFinOps
chacco38
0
180
週末にループ・エンジニアリングの理解を深めるためのスライド
nagatsu
0
700
AIは、人間らしい仕事の夢を見るか?─ AI時代のtoB/toEプロダクトを再設計する
techtekt
PRO
0
190
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
260
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
160
小さいから、全部わかる。— 常駐AI "xangi" のすすめ
sugupoko
0
190
飲食店もAIで。レジ締めやハンディシステムをつくってる話 / Using AI for restaurant management
vtryo
0
210
サイバーエージェントにおけるAI推進戦略と変革への取り組み
shotatsuge
0
630
組織における AI-DLC 実践
askul
0
220
Foundry Toolkit + Lemonade Serverでローカルワークフロー開発
seosoft
0
110
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
sira's awesome portfolio website redesign presentation
elsirapls
0
290
How to train your dragon (web standard)
notwaldorf
97
6.7k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
330
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
160
Tell your own story through comics
letsgokoyo
1
980
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?