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
Guilherme Vinicius Moreira
June 19, 2012
Programming
3
180
Geo on Rails
Guilherme Vinicius Moreira
June 19, 2012
Tweet
Share
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
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
1.8k
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
150
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1k
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
130
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
Codex の「自走力」を高める
yorifuji
0
1.2k
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
3
950
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
160
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
350
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
52k
Into the Great Unknown - MozCon
thekraken
40
2.3k
How GitHub (no longer) Works
holman
316
150k
Being A Developer After 40
akosma
91
590k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
Mind Mapping
helmedeiros
PRO
1
120
The Pragmatic Product Professional
lauravandoore
37
7.2k
Claude Code のすすめ
schroneko
67
220k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.5k
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 ?