Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Geolocalização + E-Commerce
Search
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
Transcript
34 slides
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?
More Decks by Alexandre Gaigalas
See All by Alexandre Gaigalas
Passos em Direção à Glória do REST
alganet
0
580
Porrada no Wordpress!
alganet
2
460
Microframeworks vs. Frameworks
alganet
4
390
Dados!
alganet
2
330
Domine Validação de Dados em 45min
alganet
6
500
Criação de Software para Durar
alganet
4
580
REST in PaaS
alganet
6
1.3k
Linked Data e Web Semântica
alganet
1
530
Armazenamento de Dados para Web Semântica
alganet
4
420
Other Decks in Technology
See All in Technology
実測データからサービスの成長余力を測る。負荷シナリオ・テストデータ・限界値の設計
kazatohiei
1
180
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
1
670
Libérez Firefox et Thunderbird avec nos astuces
hellosct1
0
200
正しくWeb サイトを守るためのコンテンツセキュリティーポリシー
hinalin
0
220
認知負荷の減らし方 ~開発にも日常業務にも活かせるノウハウ~
minorun365
PRO
17
11k
認知の質も文化醸成も。数年取り組んで見えてきた技術広報のKPI設計 / Tech PR KPIs: Lessons on Awareness Quality and Culture After Several Years
bitkey
PRO
0
220
業務の傍らで進める改善ループエンジニアリング
bengo4com
1
240
FPGAでアクティブセンシングがやりたくてカメラモジュールを自作した話
ryuz88
0
110
SBOM 生成ツールで 2026 Minimum Elements はどこまで満たせるのか
gokken
0
160
Dark Web - Como o Cibercrime Opera na Internet
nicholsjasper
0
120
こんなに変わった! AWSネットワークの常識
shotashiratori
16
12k
フルTypeScript × AI駆動開発で開発量が数倍に (JSConf JP 2026 スポンサーLT:NCDC株式会社)
keitaibaraki
0
140
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
610
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Automating Front-end Workflow
addyosmani
1370
210k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
480
Balancing Empowerment & Direction
lara
6
1.4k
Embracing the Ebb and Flow
colly
88
5.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
620
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
6
970
Game over? The fight for quality and originality in the time of robots
wayneb77
1
340
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
1k