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
140
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
350
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
SOC2取得の全体像
shonansurvivors
1
380
20201008_ファインディ_品質意識を育てる役目は人かAIか___2_.pdf
findy_eventslides
0
150
ユニットテストに対する考え方の変遷 / Everyone should watch his live coding
mdstoy
0
130
20250929_QaaS_vol20
mura_shin
0
110
いま注目しているデータエンジニアリングの論点
ikkimiyazaki
0
590
M5製品で作るポン置きセルラー対応カメラ
sayacom
0
150
後進育成のしくじり〜任せるスキルとリーダーシップの両立〜
matsu0228
7
2.4k
動画データのポテンシャルを引き出す! Databricks と AI活用への奮闘記(現在進行形)
databricksjapan
0
140
Goにおける 生成AIによるコード生成の ベンチマーク評価入門
daisuketakeda
2
100
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
3
20k
GopherCon Tour 概略
logica0419
2
190
いまさら聞けない ABテスト入門
skmr2348
1
200
Featured
See All Featured
Docker and Python
trallard
46
3.6k
Site-Speed That Sticks
csswizardry
11
880
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Designing for Performance
lara
610
69k
A designer walks into a library…
pauljervisheath
209
24k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Balancing Empowerment & Direction
lara
4
680
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?