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
150
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
530
Porrada no Wordpress!
alganet
2
430
Microframeworks vs. Frameworks
alganet
4
360
Dados!
alganet
2
300
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
490
Armazenamento de Dados para Web Semântica
alganet
4
400
Other Decks in Technology
See All in Technology
Red Hat OpenStack Services on OpenShift
tamemiya
0
110
Bill One 開発エンジニア 紹介資料
sansan33
PRO
5
17k
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
240
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.5k
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
120
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.5k
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
360
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
460
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.4k
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
570
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
630
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
55
Agile that works and the tools we love
rasmusluckow
331
21k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Navigating Weather and Climate Data
rabernat
0
110
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
160
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
53
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
97
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?