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
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
420
Other Decks in Technology
See All in Technology
GCASアップデート(202607-202610)
techniczna
1
200
[JAWS Festa 2026]一番いい仕事は、請求書に現れない / jawsfesta2026
sh_fk2
2
240
AIに任せられるFlutterコードベースを作る 〜仕様をコードで表し、ハーネスで守る〜
myohei
1
650
Context Ontology Accelerator 入門 (業務データの意味を、AI エージェントに渡す)
inariku
PRO
3
450
自律的なチームを作るためにTechPMがやらないこと
ny7760
1
520
AIエージェントの監視、思考を見るか行動を見るか / Monitoring AI Agents: Thoughts or Actions
yusukeshimizu
2
170
2026 Apache Flink Community Checkpoint
rmetzger
0
190
PostgreSQL オプティマイザ統計の秘密
nori_shinoda
0
360
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
180
生成AI時代のIAMのマニアックな話
takuros
6
2.6k
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
1
210
あなたのDartコードは丸見えかもしれない ~reFlutterで暴くFlutterアプリの中身と多層防御~
zozotech
PRO
0
780
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
How to build a perfect <img>
jonoalderson
1
6.2k
Tell your own story through comics
letsgokoyo
1
1.1k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
390
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Become a Pro
speakerdeck
PRO
31
6.4k
BBQ
matthewcrist
90
10k
How to make the Groovebox
asonas
2
2.5k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
450
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
The Curious Case for Waylosing
cassininazir
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?