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
440
Porrada no Wordpress!
alganet
2
400
Microframeworks vs. Frameworks
alganet
4
320
Dados!
alganet
2
250
Domine Validação de Dados em 45min
alganet
6
430
Criação de Software para Durar
alganet
4
470
REST in PaaS
alganet
6
950
Linked Data e Web Semântica
alganet
1
410
Armazenamento de Dados para Web Semântica
alganet
4
380
Other Decks in Technology
See All in Technology
国土交通省 データコンペ参加者向け勉強会
takehikohashimoto
0
390
AI長期記憶システム構築のための LLMマルチエージェントの取り組み / Awarefy-LLM-Multi-Agent
iktakahiro
2
350
freeeのモバイルエンジニアについて
freee
1
100
Engineering at LY Corporation
lycorp_recruit_jp
0
310
フルカイテン株式会社 採用資料
fullkaiten
0
40k
20241108_CS_LLMMT
shigashiyama
0
250
データの信頼性を支える仕組みと技術
chanyou0311
6
1.6k
地理情報データをデータベースに格納しよう~ GPUを活用した爆速データベース PG-Stromの紹介 ~
sakaik
1
110
State of Open Source Web Mapping Libraries
dayjournal
0
200
Spring Frameworkの新標準!? ~ RestClientとHTTPインターフェース入門 ~
ogiwarat
2
260
今、始める、第一歩。 / Your first step
yahonda
2
680
[FOSS4G 2024 Japan LT] LLMを使ってGISデータ解析を自動化したい!
nssv
1
170
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Designing Experiences People Love
moore
138
23k
Unsuck your backbone
ammeep
668
57k
Building Applications with DynamoDB
mza
90
6.1k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Music & Morning Musume
bryan
46
6.2k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9k
The Pragmatic Product Professional
lauravandoore
31
6.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
42
2.2k
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?