tim waters openhistoricalmap changes to the osm stack. sotm-us 2015

Download Tim waters OpenHistoricalMap Changes to the OSM Stack. SOTM-US 2015

If you can't read please download the document

Upload: chippy

Post on 30-Jul-2015

340 views

Category:

Documents


0 download

TRANSCRIPT

1. Tim Waters Tech Changes to the OpenStreetMap Stack 2. OpenHistoricalMap.org Very modest, really... A map of everything that has ever existed. It's putting a time slider on the world It's the worlds most out of date map. 3. What it isn't (quite) Histosm 4. What it isn't (quite) Historical Objects in OSM 5. What it is 6. Background 7. Many peoples mind Slow start Immense interest 8. Examples 9. Hunterston Scotland 19C 10. Hunterston Scotland Now 11. Saeby Denmark 19C 12. Saeby Denmark Now 13. Roman Roads 14. Roman Mainz 15. WW1 Trenches 16. Snows Infected Pump 17. Snows Infected Pump 18. Snows Infected Pump.. in OSM 19. Seattle Jeff Meyer 20. Burning Man 2008/9 21. Manhattan 1854 22. Manhattan 1854 - Digitzer 23. NYPL Building Inspector 24. Data! 25. How to add stuff to OHM 26. Imports and tracing Historical maps 27. Wikimaps 28. Wikimaps 29. Wikimaps 30. Editing JOSM change URL Embedded iD editor Tags start_date end_date (note of source map would be nice) 31. Simple? see frankies presentation cart before horse? osm way- good enough is best. Led by contributors not historical GIS experts Do whatever and let the rendered sort it out! 32. Stats 292 users 1,711,788 Ways 106,718,875 Nodes 6 planets so far 1.2G uncompressed 33. THE STACK What is the stack Website / API Editors Database export / changes replication Overpass API Map tile generation 34. Website vagrant up && vagrant ssh rails s 35. Embedded id Editor 36. Database / Replication osmosis -q --replicate-apidb authFile=dbAuth.txt validateSchemaVersion=no --write-replication workingDirectory=data 37. Overpass http://overpass.openhistoricalmap.org 38. Map Generation Get a bit techy 39. OSM2PGSQL osm2pgsql --slim -S ohm_style.style --tag-transform-script ohm_tags_transform2.lua -d ohm_gis -C 16000 --number- processes 4 ohm.osm 40. OSM2PGSQL -S ohm_style.style node,way start_date date linear node,way end_date date linear node,way start_date_year int4 linear node,way end_date_year int4 linear 41. OSM2PGSQL --tag-transform-script ohm_tags_transform2.lua https://lists.openstreetmap.org/pipermail/dev/2013-May/026933.html Kai Kruger The lua script you pass into osm2pgsql needs to implement 4 functions function filter_tags_node function filter_tags_way function filter_basic_tags_rel function filter_tags_relation_member 42. OSM2PGSQL --tag-transform-script ohm_tags_transform2.lua -- dates have to be ISO 8601 format YYYY-MM-DD -- since postgres only goes as far back as 4713 BC, we'll store the year in a new key if (keyvalues["start_date"] ~= nil ) then year,month,day = nil year = string.match(keyvalues["start_date"], "^(-?%d+%d%d%d)") if (year ~= nil) then y, month = string.match(keyvalues["start_date"], "^(-?%d+%d%d%d)- (%d%d)") if (month == nil) then month = "01" day = "01" else y, m, day = string.match(keyvalues["start_date"], "^(-?%d+%d%d %d)-(%d%d)-(%d%d)") if (day == nil) then day = "01" end 43. --because I suck at patterns! year = string.sub(year, 0, 4) month = string.sub(month, 0, 2) day = string.sub(day, 0, 2) end_date = year.. "-" .. month .. "-"..day keyvalues["end_date"] = end_date keyvalues["end_date_year"] = year else OSM2PGSQL --tag-transform-script ohm_tags_transform2.lua 44. Maps Database Create view create view planet_osm_line_2008 as select * from planet_osm_line where start_date_year = 2008; insert into geometry_columns... 'planet_osm_line_2008' 45. Maps CartoCSS / Mapnik project uses views "Datasource": { "type": "postgis", "table": " (select way,waterwayn from planet_osm_line_2008 where waterway in ('stream','drain','ditch') and (tunnel is null or tunnel != 'yes') ) as water_lines_casing", "extent": "-20037508,- 19929239,20037508,19929239", "key_field": "", "geometry_field": "way", "dbname": "ohm_gis" }, 46. mod_tile By Jaimie ohm_mod_tile Needs review! 47. Future Overpass to do date time queries iD filtering - regex on year? time slider mod_tile review to propagate down a date range to tile set Use Vector tiles and just use styles for date queries? Front end js vector rendering? Mapwarper / wikimaps UI improvements 48. Join In & hack day activites? Overpass to do date time queries More map layers (19C, 18C, Roman) iD filtering - regex on year? time slider mod_tile work review Use Vector tiles and just use styles for date queries? Front end js vector rendering Mapwarper / wikimaps UI improvements OpenHistoricalMap.org #ohm on irc.oftc.net https://lists.openstreetmap.org/listinfo/historic https://github.com/openhistoricalmap/