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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Alexandre Gaigalas
June 08, 2016
Technology
180
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Geolocalização + E-Commerce
Apresentação sobre geolocalização realizada no iMasters DevCommerce 2016
Alexandre Gaigalas
June 08, 2016
More Decks by Alexandre Gaigalas
See All by Alexandre Gaigalas
Passos em Direção à Glória do REST
alganet
0
570
Porrada no Wordpress!
alganet
2
450
Microframeworks vs. Frameworks
alganet
4
390
Dados!
alganet
2
320
Domine Validação de Dados em 45min
alganet
6
500
Criação de Software para Durar
alganet
4
570
REST in PaaS
alganet
6
1.2k
Linked Data e Web Semântica
alganet
1
520
Armazenamento de Dados para Web Semântica
alganet
4
410
Other Decks in Technology
See All in Technology
APIセキュリティを組織で実現するには~注力する点と設計・実装に入れたい対策~
riiimparm
3
890
どんな手を使っても絶対間に合わせるスケジューラ
asari194617
0
1.5k
いま好きなこと 最初はそんなに好きじゃなかった #tamagawadev
nishiuma
1
220
なぜSRE・セキュリティは評価されないのか?守りの組織を事業成長エンジンに変えた実践
cscengineer
PRO
1
1.4k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3.2k
Claude Codeで開発以外の業務も爆速化しよう!
minorun365
PRO
12
9.5k
Oracle AI Databaseデータベース・サービス: BaseDB/ExaDB-Dの可用性
oracle4engineer
PRO
1
1.1k
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
140
Does an AI Watermark Survive Translation?
machinetranslation
0
520
Genie Code ワークショップ 基礎編 / Genie-Code-Workshop-fundamental
databricksjapan
PRO
0
300
Genie Code ワークショップ 応用編 / Genie-Code-Workshop-advanced
databricksjapan
PRO
0
260
人気商品が「ちゃんと買える」をつくる ー ECの負荷改善
ykagano
1
190
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
680
The Cost Of JavaScript in 2023
addyosmani
55
10k
A Tale of Four Properties
chriscoyier
163
24k
Site-Speed That Sticks
csswizardry
13
1.5k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
For a Future-Friendly Web
brad_frost
183
10k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
400
Done Done
chrislema
186
16k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
840
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?