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
450
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
950
Linked Data e Web Semântica
alganet
1
410
Armazenamento de Dados para Web Semântica
alganet
4
380
Other Decks in Technology
See All in Technology
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
Lambdaと地方とコミュニティ
miu_crescent
2
370
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
590
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
190
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
Can We Measure Developer Productivity?
ewolff
1
150
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
いざ、BSC討伐の旅
nikinusu
2
780
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
4 Signs Your Business is Dying
shpigford
180
21k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Typedesign – Prime Four
hannesfritz
40
2.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
880
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
The Invisible Side of Design
smashingmag
298
50k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Thoughts on Productivity
jonyablonski
67
4.3k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
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?