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
400
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
420
Criação de Software para Durar
alganet
4
470
REST in PaaS
alganet
6
850
Linked Data e Web Semântica
alganet
1
350
Armazenamento de Dados para Web Semântica
alganet
4
370
Other Decks in Technology
See All in Technology
2024春 注目のWeb系 OSS & SaaS 3選
makies
0
170
M5stackで使用できるpHセンサの開発
shinrinakamura
0
110
アクセス制御にまつわる改善 / Improving access control
itkq
0
590
Microsoft for Startups Founders Hub_20240429 update
daikikanemitsu
1
2.4k
LangSmith入門―トレース/評価/プロンプト管理などを担うLLMアプリ開発プラットフォーム
os1ma
5
700
Next.js に疲れた私は Vue3 に癒やされた
akagire
0
130
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
2
340
Cloud Service Mesh に触れ合う
phaya72
1
170
生産性向上チームの紹介
cybozuinsideout
PRO
1
910
データベース02: データベースの概念
trycycle
0
180
Google Cloud Next '24 Recap(Cloud Run/k8s)
mokocm
0
330
MapLibreとAmazon Location Service
dayjournal
1
180
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
165
13k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Done Done
chrislema
178
15k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
KATA
mclloyd
16
12k
Typedesign – Prime Four
hannesfritz
36
2.1k
The Language of Interfaces
destraynor
151
23k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
79
43k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
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?