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
170
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
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
340
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.4k
Fragmented Architectures
denyspoltorak
0
110
.NET Conf 2025 の興味のあるセッ ションを復習した / dotnet conf 2025 quick recap for backend engineer
tomohisa
0
110
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
5.5k
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
170
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.6k
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
140
Grafana:建立系統全知視角的捷徑
blueswen
0
290
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
1.1k
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
150
ゆくKotlin くるRust
exoego
1
200
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
2
200
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
300
We Are The Robots
honzajavorek
0
140
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
240
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Abbi's Birthday
coloredviolet
0
4.4k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Being A Developer After 40
akosma
91
590k
Paper Plane (Part 1)
katiecoart
PRO
0
3.2k
Exploring anti-patterns in Rails
aemeredith
2
230
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
120
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 ?