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
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
360
Dados!
alganet
2
290
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
490
Armazenamento de Dados para Web Semântica
alganet
4
390
Other Decks in Technology
See All in Technology
Kiro を用いたペアプロのススメ
taikis
4
2k
2025年の医用画像AI/AI×medical_imaging_in_2025_generated_by_AI
tdys13
0
190
MariaDB Connector/C のcaching_sha2_passwordプラグインの仕様について
boro1234
0
1.1k
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
200
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
120
フィッシュボウルのやり方 / How to do a fishbowl
pauli
2
430
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
1
780
Authlete で実装する MCP OAuth 認可サーバー #CIMD の実装を添えて
watahani
0
260
2025年 山梨の技術コミュニティを振り返る
yuukis
0
110
モダンデータスタックの理想と現実の間で~1.3億人Vポイントデータ基盤の現在地とこれから~
taromatsui_cccmkhd
2
280
Claude Skillsの テスト業務での活用事例
moritamasami
1
120
まだ間に合う! Agentic AI on AWSの現在地をやさしく一挙おさらい
minorun365
19
3.2k
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
400
Everyday Curiosity
cassininazir
0
110
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
Automating Front-end Workflow
addyosmani
1371
200k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
260
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
97
Highjacked: Video Game Concept Design
rkendrick25
PRO
0
260
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
2
68
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
140
Designing Experiences People Love
moore
143
24k
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?