Transcript of OpenStreetMap and Geospatial Ruby Tim Waters sheffield ruby user group july 2015
1. OpenStreetMap (+ other Geo/Ruby things) Sheffield Ruby User
Group July 2015 Tim Waters [email protected] @tim_waters
2. Live OSM http://live.openstreetmap.fr/
https://osmlab.github.io/show-me-the-way/
3. What is OpenStreetMap? A web project to create a free and
open map of the entire world
4. History * Founded in the United Kingdom in 2004 by Steve
Coast * Ordnance Survey Data was Expensive to Use * July 2005 the
First Mapping Party Takes Place
5. Open Data
6. http://www.ted.com/talks/view/lang/en//id/788
7. Haiti http://vimeo.com/9182869
ito_haiti_berners_lee.mp4
8. Dude, we just use Google.
9. The reasons not to... Terms of Use Copyright Derived Works
No Data OSM better in many areas
10. Dude, you can't trust it
11. Wikipedia Fix the data Objectiveness Quality Control
12. Statistics Number of users 1,045,770 Number of GPS points
3,295,708,898 Number of nodes 1,788,120,111 Number of ways
171,187,609 Active users / month 17,478 Wikipedia: Number of pages:
29,551,074 Number of articles: 4,173,959 Active users / month
135,706
13. How do people map?
14. YOU CAN GET THE DATA
15. YOU CAN GET THE DATA 1) direct dump planet (26G Compressed)
whole, day, hour, minute 2) API i.e. OverPass 3) Extracts Shapefile
format (buildings, natural, place, rail, roads, water, points,
landuse)
25. OpenStreetMap Schema Folksonomy: collaboratively created
created system of tagging things. (The community creates the
OpenStreetMap tagging scheming over time)
26. Nodes, Ways and Areas
27. OSM Stack Website API Editor Map Rendering Exports
28. OSM Website Ruby on Rails Github
openstreetmap/openstreetmap-website All volunteers
29. Suitable tasks Changeset reverter, history diffs History
bounding box improvements Groups of users Area type
30. Rosemary Ruby library 4 OSM
https://github.com/sozialhelden/rosemary require 'rosemary' api =
Rosemary::Api.new node = api.find_way(174111099) #"pub",
"building"=>"yes", "food"=>"yes", "name"=>"The Red Deer",
"real_ale"=>"yes"}>
44. Ruby Mapnik :-( https://github.com/mapnik/Ruby-Mapnik Gem
maintainer gone? Code = old & broken But Mapnik = how maps are
rendered from postgis from OSM Everyone uses it C++ (rice)
45. map=Mapnik::Map.newdo|m|
m.background=Mapnik::Color.new('#777')#Agreybackground
#UsetheGooglemercatorprojection
m.srs=Mapnik::Tile::DEFAULT_OUTPUT_PROJECTION #Addalayertothemap
m.layer'countries'do|l| l.styledo|s|
#Addaruletothestyle(thisoneisadefaultrule) s.ruledo|default|
default.fill=Mapnik::Color.new('#880000') end end
l.srs="+proj=latlong+datum=WGS84"#setthesrsofthelayer
l.datasource=Mapnik::Datasource.create:type=>'shape',
:file=>"myshapefile.shp" end end
map.zoom_to_box(map.layers.first.envelope)
map.render_to_file('my_map.png')
46. Thanks! @tim_waters Leeds Ruby Thing last Thursday every
month