$30 off During Our Annual Pro Sale. View Details »
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
510
Porrada no Wordpress!
alganet
2
430
Microframeworks vs. Frameworks
alganet
4
350
Dados!
alganet
2
280
Domine Validação de Dados em 45min
alganet
6
470
Criação de Software para Durar
alganet
4
530
REST in PaaS
alganet
6
1.2k
Linked Data e Web Semântica
alganet
1
480
Armazenamento de Dados para Web Semântica
alganet
4
390
Other Decks in Technology
See All in Technology
Introduction to Bill One Development Engineer
sansan33
PRO
0
330
.NET 10 のパフォーマンス改善
nenonaninu
2
4.7k
DGX SparkでローカルLLMをLangChainで動かした話
ruzia
1
260
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
37k
ECMAScript仕様の最新動向: プロセスの変化と仕様のトレンド
uhyo
2
490
mablでリグレッションテストをデイリー実行するまで #mablExperience
bengo4com
0
470
Modern Data Stack大好きマンが語るSnowflakeの魅力
sagara
0
280
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.3k
履歴テーブル、今回はこう作りました 〜 Delegated Types編 〜 / How We Built Our History Table This Time — With Delegated Types
moznion
15
9.4k
AI駆動開発によるDDDの実践
dip_tech
PRO
0
290
安いGPUレンタルサービスについて
aratako
1
1.7k
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
A designer walks into a library…
pauljervisheath
210
24k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
690
Context Engineering - Making Every Token Count
addyosmani
9
460
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
For a Future-Friendly Web
brad_frost
180
10k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Docker and Python
trallard
46
3.7k
Producing Creativity
orderedlist
PRO
348
40k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Side Projects
sachag
455
43k
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?