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
460
Porrada no Wordpress!
alganet
2
400
Microframeworks vs. Frameworks
alganet
4
320
Dados!
alganet
2
260
Domine Validação de Dados em 45min
alganet
6
440
Criação de Software para Durar
alganet
4
480
REST in PaaS
alganet
6
980
Linked Data e Web Semântica
alganet
1
430
Armazenamento de Dados para Web Semântica
alganet
4
390
Other Decks in Technology
See All in Technology
30分でわかるデータ分析者のためのディメンショナルモデリング #datatechjp / 20250120
kazaneya
PRO
15
3.8k
新しいスケーリング則と学習理論
taiji_suzuki
9
3.6k
C++26 エラー性動作
faithandbrave
2
870
知っててうれしい HTTP Cookie を使ったセッション管理について
greendrop
1
110
SpiderPlus & Co. エンジニア向け会社紹介資料
spiderplus_cb
0
410
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
130
pg_bigmをRustで実装する(第50回PostgreSQLアンカンファレンス@オンライン 発表資料)
shinyakato_
0
150
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
33k
型情報を用いたLintでコード品質を向上させる
sansantech
PRO
2
220
Qiita埋め込み用スライド
naoki_0531
0
5.5k
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
250
.NET 9 のパフォーマンス改善
nenonaninu
0
2.2k
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Being A Developer After 40
akosma
89
590k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
230
The World Runs on Bad Software
bkeepers
PRO
66
11k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Making the Leap to Tech Lead
cromwellryan
133
9k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
We Have a Design System, Now What?
morganepeng
51
7.3k
Thoughts on Productivity
jonyablonski
68
4.4k
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?