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
2
130
Geolocalização + E-Commerce
Apresentação sobre geolocalização realizada no iMasters DevCommerce 2016
Alexandre Gaigalas
June 08, 2016
Tweet
Share
More Decks by Alexandre Gaigalas
See All by Alexandre Gaigalas
Passos em Direção à Glória do REST
alganet
0
490
Porrada no Wordpress!
alganet
2
420
Microframeworks vs. Frameworks
alganet
4
340
Dados!
alganet
2
280
Domine Validação de Dados em 45min
alganet
6
460
Criação de Software para Durar
alganet
4
520
REST in PaaS
alganet
6
1.1k
Linked Data e Web Semântica
alganet
1
470
Armazenamento de Dados para Web Semântica
alganet
4
390
Other Decks in Technology
See All in Technology
職種の壁を溶かして開発サイクルを高速に回す~情報透明性と職種越境から考えるAIフレンドリーな職種間連携~
daitasu
0
170
Rustから学ぶ 非同期処理の仕組み
skanehira
1
150
未経験者・初心者に贈る!40分でわかるAndroidアプリ開発の今と大事なポイント
operando
5
750
Aurora DSQLはサーバーレスアーキテクチャの常識を変えるのか
iwatatomoya
1
1.2k
テストを軸にした生き残り術
kworkdev
PRO
0
220
品質視点から考える組織デザイン/Organizational Design from Quality
mii3king
0
210
Android Audio: Beyond Winning On It
atsushieno
0
2.9k
Webアプリケーションにオブザーバビリティを実装するRust入門ガイド
nwiizo
7
890
20250905_MeetUp_Ito-san_s_presentation.pdf
magicpod
1
100
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
4
10k
20250913_JAWS_sysad_kobe
takuyay0ne
2
250
DroidKaigi 2025 Androidエンジニアとしてのキャリア
mhidaka
2
380
Featured
See All Featured
Making Projects Easy
brettharned
117
6.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Facilitating Awesome Meetings
lara
55
6.5k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Become a Pro
speakerdeck
PRO
29
5.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
The Language of Interfaces
destraynor
161
25k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
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?