diff --git a/src/coverage_busstop_update.sh b/src/coverage_busstop_update.sh index 7398441..4c7eb09 100755 --- a/src/coverage_busstop_update.sh +++ b/src/coverage_busstop_update.sh @@ -3,6 +3,9 @@ mkdir database rm */update.sql +#java -cp .:osmCoverage.jar:hayashi_0225.jar:postgresql-9.4.1212.jar:hsqldb_2.2.9.jar osm.jp.coverage.busstop.DbBusstop -DROP +java -cp .:osmCoverage.jar:hayashi_0225.jar:postgresql-9.4.1212.jar:hsqldb_2.2.9.jar osm.jp.coverage.busstop.DbBusstop + java -cp .:osmCoverage.jar:hayashi_0225.jar:postgresql-9.4.1212.jar:hsqldb_2.2.9.jar osm.jp.coverage.busstop.Busstop -update java -cp .:osmCoverage.jar:hayashi_0225.jar:postgresql-9.4.1212.jar osm.jp.postgis.Do_sqlfiles -update java -cp .:osmCoverage.jar:hayashi_0225.jar:postgresql-9.4.1212.jar:hsqldb_2.2.9.jar osm.jp.coverage.busstop.Coverage coverage.csv diff --git a/src/osm/jp/coverage/busstop/DbBusstop.java b/src/osm/jp/coverage/busstop/DbBusstop.java index c1bf663..4e2545a 100644 --- a/src/osm/jp/coverage/busstop/DbBusstop.java +++ b/src/osm/jp/coverage/busstop/DbBusstop.java @@ -554,21 +554,22 @@ public static void export(Connection con) { try { System.out.println("TABLE: BUS_STOP"); - System.out.println("\"name\",\"lat\",\"lon\",\"fixed\",\"ifile\""); - PreparedStatement ps8 = con.prepareStatement("SELECT name,lat,lon,fixed,ifile FROM bus_stop"); + System.out.println("\"gmlid\",\"name\",\"lat\",\"lon\",\"fixed\",\"ifile\""); + PreparedStatement ps8 = con.prepareStatement("SELECT gmlid,name,lat,lon,fixed,ifile FROM bus_stop"); try (ResultSet rset8 = ps8.executeQuery()) { while (rset8.next()) { - String name = rset8.getString(1); - Double lat = rset8.getDouble(2); - Double lon = rset8.getDouble(3); - int fixed = rset8.getInt(4); - String ifile = rset8.getString(5); - System.out.println("\""+ name +"\","+ lat +","+ lon +","+ fixed +",\""+ ifile +"\""); + String gmlid = rset8.getString("gmlid"); + String name = rset8.getString("name"); + Double lat = rset8.getDouble("lat"); + Double lon = rset8.getDouble("lon"); + int fixed = rset8.getInt("fixed"); + String ifile = rset8.getString("ifile"); + System.out.println("\""+ gmlid +"\",\""+ name +"\","+ lat +","+ lon +","+ fixed +",\""+ ifile +"\""); } } } catch (SQLException e) { - e.printStackTrace(); + e.printStackTrace(); } } diff --git a/src/t_BUSSTOP.sql b/src/t_BUSSTOP.sql index 1b8cf09..d3519c1 100644 --- a/src/t_BUSSTOP.sql +++ b/src/t_BUSSTOP.sql @@ -32,17 +32,15 @@ ---<< database: hsqldb >>--- CREATE TABLE bus_stop ( - idref VARCHAR(12) NOT NULL, + gmlid VARCHAR(12) NOT NULL, name VARCHAR(128), - kana VARCHAR(128), lat DOUBLE, lon DOUBLE, fixed INT, - fixed1 INT, area INT, ifile VARCHAR(128), up INT, - CONSTRAINT bus_stop_pk PRIMARY KEY(idref)); + CONSTRAINT bus_stop_pk PRIMARY KEY(gmlid)); CREATE TABLE existing_data ( idref VARCHAR(12) NOT NULL,