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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
580
Porrada no Wordpress!
alganet
2
450
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
520
Armazenamento de Dados para Web Semântica
alganet
4
410
Other Decks in Technology
See All in Technology
スマートロックを支えるFlutter × ネイティブ連携の実践 / Flutter and Native Integration in Practice: Powering Smart Locks
bitkey
PRO
0
120
今から始めるAWS環境の暗号移行 - ポスト量子時代に備える
sato4mi
0
130
生き様としてのSRE
hokkai7go
0
140
ひとりで始めた AI駆動開発、チームに広げて何が変わったのか
kenichiodo
1
170
AIコーディングエージェント開発_全体像
happysamurai294
0
140
自律的なチームを作るためにTechPMがやらないこと
ny7760
0
300
re:Invent の去年のスケジュールを公開します!
miu_crescent
PRO
0
130
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
170
AI Search (Foundry IQ) におけるRAGデータの準備と配置
ryomaru0825
1
100
AI AgentによるEmbedded SREの取り組み
tgidgd
1
280
増え続けるプロダクトの品質をどう担保するか。ProductSpecとTypeScriptによる取り組み
joere
2
260
Vue で書く 空間コンピューティング、TresJS と WebXR を使ったXR デバイスのフロントエンド開発
hiranuma
0
140
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
370
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Building AI with AI
inesmontani
PRO
1
1.3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
380
sira's awesome portfolio website redesign presentation
elsirapls
0
480
So, you think you're a good person
axbom
PRO
2
2.2k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
770
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
The SEO Collaboration Effect
kristinabergwall1
1
610
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?