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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
550
Porrada no Wordpress!
alganet
2
440
Microframeworks vs. Frameworks
alganet
4
370
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
クレデンシャル流出 ― 攻撃 3 時間 vs 復旧 10 時間。この非対称性にどう備えるか
kazzpapa3
3
550
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
100
Bucharest Tech Week 2026 - Guardians of the Cloud-Native Galaxy
edeandrea
PRO
0
140
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
110
【2026年版】 ベクトル検索とEmbedding最前線
mocobeta
23
7.5k
螺旋型キャリアの生存戦略 / kinoko-conf2026
rakus_dev
1
940
「軸足」は 固定しなくていい - 熱量と強みで描く、しなやかなキャリアの形
kakehashi
PRO
1
260
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
120
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
0
780
2026年6月23日 Syncable Tech + Start Python Club にて
hamukazu
0
150
AWS Security Agent といっしょに脅威モデリングをやってみよう
amarelo_n24
1
210
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
830
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
Raft: Consensus for Rubyists
vanstee
141
7.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
200
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
Ethics towards AI in product and experience design
skipperchong
2
310
The SEO Collaboration Effect
kristinabergwall1
1
490
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
200
sira's awesome portfolio website redesign presentation
elsirapls
0
280
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
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?