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
人とエージェントが高め合う協業設計
kintotechdev
0
750
SRENEXT_2026_Chairs__Talks_in_Tamachi.sre.pdf
srenext
1
140
AIとハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
3
780
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
370
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
2
1k
_NIKKEI_Tech_Talk__勉強会は熱量では続かない___17回続いた輪読会の設計術.pdf
_awache
1
100
JAWS_ICEBERG_BASECAMP
iqbocchi
2
110
GoでCコンパイラを作った話
repunit
0
150
20260720_クラウド女子会×PyLadiesTokyoコラボ Amazon Bedrock ハンズオン用資料
yuuka51
1
110
AI時代の開発生産性を捉え直す — 経営と現場をつなぐ「開発組織のオブザーバビリティ」— / AI Dev Ex Conference 2026
tkyowa
1
1.3k
2年前に削除したPHPクラスが、 ある日突然決済をエラーにした
ykagano
1
770
AI、CDK と協働する Full TypeScript アプリケーション開発 / Full TypeScript Application with AI and CDK
geekplus_tech
2
480
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How STYLIGHT went responsive
nonsquared
100
6.2k
Color Theory Basics | Prateek | Gurzu
gurzu
0
390
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1k
Google's AI Overviews - The New Search
badams
0
1.1k
Context Engineering - Making Every Token Count
addyosmani
9
1k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
660
Joys of Absence: A Defence of Solitary Play
codingconduct
1
420
The Cult of Friendly URLs
andyhume
79
7k
Agile that works and the tools we love
rasmusluckow
331
22k
[SF Ruby Conf 2025] Rails X
palkan
2
1.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?