From b34378be274db787086470804333346f4f86e685 Mon Sep 17 00:00:00 2001 From: Daniel Kastl Date: Sat, 29 Jun 2013 09:08:05 +0900 Subject: [PATCH] changed gid back to integer --- src/Export2DB.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Export2DB.cpp b/src/Export2DB.cpp index 5a5fc852..2be253fc 100644 --- a/src/Export2DB.cpp +++ b/src/Export2DB.cpp @@ -68,7 +68,7 @@ int Export2DB::connect() void Export2DB::createTables() { - std::string create_nodes("CREATE TABLE " + tables_prefix + "nodes (ID bigint PRIMARY KEY, lon decimal(11,8), lat decimal(11,8), numOfUse smallint);"); + std::string create_nodes("CREATE TABLE " + tables_prefix + "nodes (id bigint PRIMARY KEY, lon decimal(11,8), lat decimal(11,8), numOfUse smallint);"); PGresult *result = PQexec(mycon, create_nodes.c_str()); if (PQresultStatus(result) != PGRES_COMMAND_OK) { @@ -80,7 +80,8 @@ void Export2DB::createTables() std::cout << "Nodes table created" << std::endl; } - std::string create_ways("CREATE TABLE " + tables_prefix + "ways (gid bigint, class_id integer not null, length double precision, name text, x1 double precision, y1 double precision, x2 double precision, y2 double precision, reverse_cost double precision, rule text, to_cost double precision, maxspeed_forward integer, maxspeed_backward integer, osm_id bigint, priority double precision DEFAULT 1);" + // gid cannot be "bigint" right now because pgRouting doesn't support "bigint" + std::string create_ways("CREATE TABLE " + tables_prefix + "ways (gid integer, class_id integer not null, length double precision, name text, x1 double precision, y1 double precision, x2 double precision, y2 double precision, reverse_cost double precision, rule text, to_cost double precision, maxspeed_forward integer, maxspeed_backward integer, osm_id bigint, priority double precision DEFAULT 1);" + " SELECT AddGeometryColumn('" + tables_prefix + "ways','the_geom',4326,'LINESTRING',2);"); result = PQexec(mycon, create_ways.c_str()); if (PQresultStatus(result) != PGRES_COMMAND_OK)