Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2012
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. # Live Demo at EuRuCamp Berlin of deploying a routing app to Heroku using @spacialdb
  2. # Goal is to have your own deployment of a location based application that does street routing: http://spacialdb-routing.heroku.com/
  3.  
  4. # ===============================================
  5. # PREREQUISITES:
  6. # ===============================================
  7.  
  8. # 1. Get a Heroku account: http://heroku.com
  9.  
  10. # 2. Email Kashif.Rasul@gmail.com so we can give you access to the SpacialDB alpha Heroku addon
  11.  
  12. # 3. Install PostGIS
  13. $ brew install postgis cmake
  14.  
  15. # 4. Install osm2pgrouting
  16. $ git clone git://github.com/kashif/osm2pgrouting.git
  17. $ cd osm2pgrouting
  18. $ cmake .
  19. $ make
  20. $ cd ..
  21.  
  22.  
  23. # =========================================================
  24. # Live Deployment: We will do this together during the talk
  25. # =========================================================
  26.  
  27. $ git clone git://github.com/spacialdb/Routing-Heroku-Example.git
  28. $ cd Routing-Heroku-Example
  29.  
  30. $ heroku create <some-app-name>
  31. $ heroku addons:add spacialdb:test
  32.  
  33. $ heroku config
  34. SPACIALDB_URL => postgres://user:secret@beta.spacialdb.com:9999/heroku_shoaib_burq_517e
  35.  
  36. # set up env variables
  37. $ wget https://gist.github.com/raw/996860/8eb0429d8bc6d95e4843d9dd56ff96c91830f732/print_spacialdb_params.rb
  38. # run the printed export stat
  39. $ chmod +x print_spacialdb_params.rb
  40. $ heroku config
  41. $ SPACIALDB_URL=postgres://user:secret@beta.spacialdb.com:9999/heroku_shoaib_burq_517e ./print_spacialdb_params.rb
  42.  
  43. # get the data
  44. $ wget -O map.osm http://api.openstreetmap.org/api/0.6/map?bbox=13.4066263,52.494329,13.420215,52.520088
  45. $ wget -O mapconfig.xml https://gist.github.com/raw/996868/cdcfa8439eca48b1aa517b069fb1a7d65888e070/mapconfig.xml
  46.  
  47. # import the data
  48. $ osm2pgrouting -file map.osm \
  49. -conf ./mapconfig.xml \
  50. -dbname $SPACIALDB_DB \
  51. -user $SPACIALDB_USER \
  52. -host $SPACIALDB_HOST \
  53. -port $SPACIALDB_PORT \
  54. -passwd $SPACIALDB_PASS -clean
  55.  
  56. $ git push heroku master
  57.  
  58. $ heroku open
  59.  
  60. # For more checkout: http://beta.spacialdb.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement