Browse files

specify db name on the command line

  • Loading branch information...
1 parent 244440f commit 51f63a8b96e68dcd717517e7a05976cea3b7c0de @gasman gasman committed Oct 29, 2012
Showing with 6 additions and 5 deletions.
  1. +2 −1 add_linestrings.py
  2. +2 −2 build_paths.py
  3. +2 −2 graph_reduction.txt
View
3 add_linestrings.py
@@ -1,6 +1,7 @@
+from sys import argv
import psycopg2
-conn = psycopg2.connect("dbname=traingraph_eu user=postgres")
+conn = psycopg2.connect("dbname=%s user=postgres" % argv[1])
paths_qry = conn.cursor()
cur = conn.cursor()
View
4 build_paths.py
@@ -1,7 +1,7 @@
+from sys import argv
import psycopg2
-conn = psycopg2.connect("dbname=traingraph user=postgres")
-nodes_qry = conn.cursor()
+conn = psycopg2.connect("dbname=%s user=postgres" % argv[1])
cur = conn.cursor()
while True:
View
4 graph_reduction.txt
@@ -94,11 +94,11 @@ CREATE INDEX idx_path_nodes_path ON path_nodes(path_id, sequence_id);
8) Run build_paths.py to populate the table of paths
-python build_paths.py
+python build_paths.py traingraph
9) Populate the linestring and length fields of the paths table
-python add_linestrings.py
+python add_linestrings.py traingraph
10) Output as KML

0 comments on commit 51f63a8

Please sign in to comment.