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
Geo on Rails
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Guilherme Vinicius Moreira
June 19, 2012
Programming
180
3
Share
Geo on Rails
Guilherme Vinicius Moreira
June 19, 2012
More Decks by Guilherme Vinicius Moreira
See All by Guilherme Vinicius Moreira
Introdução ao conceito de Gamificação
guivinicius
0
310
Other Decks in Programming
See All in Programming
へんな働き方
yusukebe
6
2.9k
AIエージェントで業務改善してみた
taku271
0
500
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
380
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
180
Rethinking API Platform Filters
vinceamstoutz
0
11k
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
700
Coding as Prompting Since 2025
ragingwind
0
780
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
2.9k
おれのAgentic Coding 2026/03
tsukasagr
1
140
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
450
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
200
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
200
Agile that works and the tools we love
rasmusluckow
331
21k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
Raft: Consensus for Rubyists
vanstee
141
7.4k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
220
Joys of Absence: A Defence of Solitary Play
codingconduct
1
340
The Pragmatic Product Professional
lauravandoore
37
7.2k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
140
Un-Boring Meetings
codingconduct
0
260
Skip the Path - Find Your Career Trail
mkilby
1
100
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
240
Transcript
Geo On Rails Um guia para manter o seu cabelo.
por @guivinicius
whoami Guilherme || Harry Desenvolvedor na Novakoasin Um dos fundadores
do GURU Sorocaba
Motivo
Objetivo Dar uma visão e as ferramentas para um estudo
detalhado.
Metas - Explicar os termos - Mostrar ferramentas para Ruby
/ Rails - Um pouco código.
Programação Espacial
Programação Espacial Tratar espaços e objetos físicos no contexto de
programação. Interação e relacionamento entre esses objetos físicos.
Programação Espacial Me ache as linhas de ônibus que coincidam
o trajeto em uma percentagem maior que 60%. Me retorne todos os veículos que passaram num raio de 10km da usina nuclear XYZ no dia 10/11/2012.
Termos Importantes GIS: Geographical Information System Layers: Camadas WMS: Web
Mapping Service. Projeção: Representação plana do globo. Geometria: Tipo de dados em um GIS.
GIS Sistemas que representam dados geográficos.
GIS Sistemas que representam dados geográficos.
Layers Camadas que podem agrupar dados. RASTER VECTOR
Layers
WMS http://openstreetmap.org
WMS http://worldwind.arc.nasa.gov/java/
WMS http://maps.yahoo.com/
WMS http://br.bing.com/maps/
WMS http://www.mapmatters.org/ ou Mapserver http://mapserver.org/ ou $$ Soluções Privadas $$
Projeções Meio de representar uma superfície esférica (Terra) em uma
superfície plana.
Projeções
Projeções SRID: Como a projeção é identificada dentro de um
banco espacial. (System Reference ID) EPSG: 4326 / EPSG: 900913 (Google) http://spatialreference.org/
Geometrias Point Line Polygon • Multiline Multipolygon
Geometrias Geometry Collection • •
Geometrias ESRI Shapefile Mapinfo Formato de dados mais utilizados. .shp
.shx .dbf .tab Contém geometrias e muitas outras informações, como índices e etc.
Ferramentas Bancos da Dados - PostgreSQL + PostGIS - MongoDB
- MySQL - Oracle Spatial the best *PostGIS é uma extensão para o PostgreSQL que adiciona habilidades espaciais.
Ferramentas • Habilidade de armazenar geometrias nas tabelas. • Disponibiliza
funções espaciais como distance() ou intersection() • Implementa índices espaciais. O que eles fazem de diferente ?
Ferramentas Ruby Gems - RGeo - RGeo-geojson - RGeo-shapefile -
ffi-geos - GeoRuby - SpatialAdapter - Ruby geocoder - Squeel
Ferramentas Client-side http://openlayers.org/
Ferramentas Client-side Heatmaps https://github.com/pa7/heatmap.js https://github.com/dazuma/thermo.js https://github.com/sunng87/heatcanvas
Ferramentas
Ferramentas http://www.qgis.org/
Ferramentas http://mapserver.org/ http://www.pgrouting.org/ Publicar dados espaciais na web, criar seu
próprio WMS. Estende o PostgreSQL + PostGIS para algoritmos de roteamento.
Meu ‘stack’ atual PostgreSQL + PostGIS + PgRouting GeoRuby +
SpatialAdapter OpenLayers Mapserver
Código !! gemfile
Código !! database.yml * Documentado na gem activerecord-postgis-adapter
Código !! tipo point! <RGeo::Geographic::SphericalPointImpl:0x806532d8 "POINT (-47.45590989999999 -23.5062288)">
Código !! p1.latlon.distance(p2.latlon) => 3802.0170205027907 (miles)
Pra onde ir daqui. • Instale alguns bancos espaciais (PostgreSQL)
• gem install nas gems mencionadas. • Crie uma app Rails e com objetos espaciais • Utilize o OpenLayers e mostre alguns dados.
Fontes de dados. http://www.naturalearthdata.com/downloads/ http://geocommons.com/ http://dados.gov.br/ http://www.ibge.gov.br/mapas_ibge/bases.php
Obrigado! @guivinicius @gurusorocaba Perguntas ?