$30 off During Our Annual Pro Sale. View Details »
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
150
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
520
Porrada no Wordpress!
alganet
2
430
Microframeworks vs. Frameworks
alganet
4
350
Dados!
alganet
2
280
Domine Validação de Dados em 45min
alganet
6
470
Criação de Software para Durar
alganet
4
530
REST in PaaS
alganet
6
1.2k
Linked Data e Web Semântica
alganet
1
480
Armazenamento de Dados para Web Semântica
alganet
4
390
Other Decks in Technology
See All in Technology
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
6
2.4k
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.7k
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
2
1.7k
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
150
Strands AgentsとNova 2 SonicでS2Sを実践してみた
yama3133
1
1.9k
ソフトウェアエンジニアとAIエンジニアの役割分担についてのある事例
kworkdev
PRO
0
260
意外と知らない状態遷移テストの世界
nihonbuson
PRO
1
250
さくらのクラウド開発ふりかえり2025
kazeburo
2
1.2k
ESXi のAIOps だ!2025冬
unnowataru
0
370
Claude Codeを使った情報整理術
knishioka
11
6.2k
Agent Skillsがハーネスの垣根を超える日
gotalab555
6
4.3k
20251222_サンフランシスコサバイバル術
ponponmikankan
2
140
Featured
See All Featured
HDC tutorial
michielstock
0
270
Prompt Engineering for Job Search
mfonobong
0
130
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
92
The untapped power of vector embeddings
frankvandijk
1
1.5k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
51
46k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
Highjacked: Video Game Concept Design
rkendrick25
PRO
0
250
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Building Applications with DynamoDB
mza
96
6.8k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
310
Paper Plane
katiecoart
PRO
0
44k
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?