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
470
Porrada no Wordpress!
alganet
2
410
Microframeworks vs. Frameworks
alganet
4
330
Dados!
alganet
2
270
Domine Validação de Dados em 45min
alganet
6
450
Criação de Software para Durar
alganet
4
500
REST in PaaS
alganet
6
1k
Linked Data e Web Semântica
alganet
1
450
Armazenamento de Dados para Web Semântica
alganet
4
390
Other Decks in Technology
See All in Technology
Lakehouse в Лемана Тех. От архитектуры до оптимизации
emeremyanina1234
0
510
golang-migrate VS Atlas !? 技術選定のポイントと学び ~DBマイグレーションツール選定の実例を通して~ / golang-migrate vs Atlas ! What is the point of technology selection and what you can learn from the examples of DB migration tool selection?
nttcom
0
120
SwiftUIとMetalで簡単に作るレアカード風UI
stoticdev
1
110
ITベンダーから見る内製化支援の本質/in-house-dev
slsops
1
190
変化に強いテーブル設計の勘所 / Table design that is resistant to changes
soudai
12
3.1k
エンジニアのための 法規制への取り組み方 #healthtechmeetup
77web
0
280
計装を見直してアプリケーションパフォーマンスを改善させた話
donkomura
2
220
テストコードにはテストの意図を込めよう(2025年版) #retechtalk / Put the intent of the test 2025
nihonbuson
PRO
15
2.3k
thanks_react_router_v7
tascript
0
100
encoding/json v2を予習しよう!
yuyu_hf
PRO
1
230
GrafanaをClaude DesktopからMCPで触ってみた
hamadakoji
0
1.3k
LLMベースAIの基本 / basics of LLM based AI
kishida
9
2.3k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
105
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
33k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
5
620
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
4 Signs Your Business is Dying
shpigford
183
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
A better future with KSS
kneath
239
17k
Six Lessons from altMBA
skipperchong
28
3.8k
The Pragmatic Product Professional
lauravandoore
33
6.6k
Visualization
eitanlees
146
16k
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?