diff --git a/src/osm/jp/coverage/fuel/Fuel.java b/src/osm/jp/coverage/fuel/Fuel.java index 90331fa..d37e197 100644 --- a/src/osm/jp/coverage/fuel/Fuel.java +++ b/src/osm/jp/coverage/fuel/Fuel.java @@ -31,9 +31,6 @@ /** * メイン * - * java -cp .:ConvBusstop.jar:hayashi_0225.jar:hsqldb_2.2.9.jar osm.jp.ConvBusstop [option] - * OPTION: -check OSMデータ上に既存のバス停が存在するかどうかをチェックする - * * @param args * @throws IOException * @throws SQLException @@ -94,13 +91,9 @@ double lat = rset1.getDouble("lat"); double lon = rset1.getDouble("lon"); int score = rset1.getInt("score"); - String idref = null; + int area = 0; - if (rset1.getString("idref").equals("5338111023")) { - int dummy = 0; - } - // 指定の緯度経度を中心とする半径100x2m四方の矩形領域 RectArea rect = new RectArea(lat, lon, NEER); // 100m 四方 ps2.setDouble(1, rect.minlat); @@ -108,6 +101,7 @@ ps2.setDouble(3, rect.minlon); ps2.setDouble(4, rect.maxlon); try (ResultSet rset2 = ps2.executeQuery()) { + String idref = null; double distance = 999999.9D; while (rset2.next()) { double lat2 = rset2.getDouble("lat"); @@ -119,17 +113,17 @@ area = rset2.getInt("area"); } } - } - if (idref != null) { - System.out.println(sql3); - System.out.println("UPDATE "+ DbFuel.TABLE_NAME +" SET fixed1="+ score +" WHERE idref="+ idref +" and area=" + area); - ps3.setInt(1, score); - ps3.setString(2, idref); - ps3.setInt(3, area); - ps3.executeUpdate(); - } - else { - System.out.println("NOT FOUND! idref="+ osmid); + if (idref != null) { + System.out.println(sql3); + System.out.println("UPDATE "+ DbFuel.TABLE_NAME +" SET fixed1="+ score +" WHERE idref="+ idref +" and area=" + area); + ps3.setInt(1, score); + ps3.setString(2, idref); + ps3.setInt(3, area); + ps3.executeUpdate(); + } + else { + System.out.println("NOT FOUND! idref="+ osmid); + } } } }