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
530
Porrada no Wordpress!
alganet
2
430
Microframeworks vs. Frameworks
alganet
4
360
Dados!
alganet
2
300
Domine Validação de Dados em 45min
alganet
6
480
Criação de Software para Durar
alganet
4
530
REST in PaaS
alganet
6
1.2k
Linked Data e Web Semântica
alganet
1
500
Armazenamento de Dados para Web Semântica
alganet
4
400
Other Decks in Technology
See All in Technology
React 19時代のコンポーネント設計ベストプラクティス
uhyo
4
1.3k
22nd ACRi Webinar - NTT Kawahara-san's slide
nao_sumikawa
0
130
ランサムウェア対策としてのpnpm導入のススメ
ishikawa_satoru
0
310
OpenShiftでllm-dを動かそう!
jpishikawa
0
210
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
680
1,000 にも届く AWS Organizations 組織のポリシー運用をちゃんとしたい、という話
kazzpapa3
1
250
20260208_第66回 コンピュータビジョン勉強会
keiichiito1978
0
240
新規事業開発でのAWS活用
amixedcolor
1
150
ECS障害を例に学ぶ、インシデント対応に備えたAIエージェントの育て方 / How to develop AI agents for incident response with ECS outage
iselegant
5
750
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
3
250
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
440
個人的3D Gaussian Splattingニュースをご紹介 / sharing 3d gaussian splatting news
drumath2237
0
180
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Scaling GitHub
holman
464
140k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
230
Building an army of robots
kneath
306
46k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Become a Pro
speakerdeck
PRO
31
5.8k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
77
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
450
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
For a Future-Friendly Web
brad_frost
182
10k
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?