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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
320
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
AI x 開発生産性を取り巻く予算戦略と投資対効果
i35_267
7
2.9k
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
170
2026年のソフトウェア開発を考える(2026/07版) / Agentic Software Engineering 2026-07 Findy Edition
twada
PRO
25
11k
文字起こし基盤の信頼性
abnoumaru
0
120
OpenTelemetryにおけるGoのゼロコード・コンパイル時計装について #fukuokago
quiver
0
210
GoでCコンパイラを作った話
repunit
0
150
データと地図で読む 大井町の「かわるもの、かわらないもの」
yoshiyama_hana
0
140
複数プロダクトで進めるAI機能実装 ── 実践から得たリアルな学びとロードマップ実現への挑戦 / AICon2026_yanari
rakus_dev
1
270
AI時代におけるテストの基礎の再定義 / Rethinking the Fundamentals of Testing in the AI Era
mineo_matsuya
13
4.4k
AI時代の開発生産性を捉え直す — 経営と現場をつなぐ「開発組織のオブザーバビリティ」— / AI Dev Ex Conference 2026
tkyowa
1
1.3k
OPENLOGI Company Profile for engineer
hr01
1
74k
発表と総括 / Presentations and Summary
ks91
PRO
0
190
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
520
The Cost Of JavaScript in 2023
addyosmani
55
10k
Claude Code のすすめ
schroneko
67
230k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The agentic SEO stack - context over prompts
schlessera
0
850
Accessibility Awareness
sabderemane
1
160
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
How STYLIGHT went responsive
nonsquared
100
6.2k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
420
Google's AI Overviews - The New Search
badams
0
1.1k
Agile that works and the tools we love
rasmusluckow
331
22k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
210
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?