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
120
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
430
Porrada no Wordpress!
alganet
2
400
Microframeworks vs. Frameworks
alganet
4
320
Dados!
alganet
2
250
Domine Validação de Dados em 45min
alganet
6
430
Criação de Software para Durar
alganet
4
470
REST in PaaS
alganet
6
920
Linked Data e Web Semântica
alganet
1
390
Armazenamento de Dados para Web Semântica
alganet
4
380
Other Decks in Technology
See All in Technology
フルカイテン株式会社 採用資料
fullkaiten
0
32k
「認証認可」という体験をデザインする ~Nekko Cloud認証認可基盤計画
logica0419
2
440
なにもしてないのにNew Relicのデータ転送量が増えていたときに確認したこと
tk3fftk
2
230
AI活用したくてもできなかった不動産SaaSの今とこれから
nealle
0
330
Analytics-Backed App Widget Development - Served with Jetpack Glance
miyabigouji
0
610
学術機関におけるID連携とOpenID Connect
fujie
0
250
サーバー管理しないサーバーサービスManaged DevOps Pool
kkamegawa
0
130
ロリポップ! for Gamersを支えるインフラ/lolipop for gamers infrastructure
takumakume
0
130
たった1人からはじめる【Agile Community of Practice】~ソース原理とFearless Changeを添えて~
ktc_corporate_it
1
480
Tricentisにおけるテスト自動化へのAI活用ご紹介/20240910Shunsuke Katakura
shift_evolve
0
200
サーバレスでモバイルアプリ開発! NTTコム「ビジネスdアプリ」のアーキテクチャ / The architecture of business d app
nttcom
12
240
LINEヤフーのフロントエンド組織・体制の紹介
lycorp_recruit_jp
1
1.2k
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.8k
Done Done
chrislema
180
16k
No one is an island. Learnings from fostering a developers community.
thoeni
18
2.9k
How GitHub Uses GitHub to Build GitHub
holman
472
290k
KATA
mclloyd
27
13k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
363
22k
Building Flexible Design Systems
yeseniaperezcruz
325
38k
The Illustrated Children's Guide to Kubernetes
chrisshort
47
48k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
225
22k
GraphQLとの向き合い方2022年版
quramy
43
13k
Typedesign – Prime Four
hannesfritz
39
2.3k
Building an army of robots
kneath
302
42k
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?