diff --git a/src/osm/jp/api/HttpPOST.java b/src/osm/jp/api/HttpPOST.java index b85f2f4..8ca75b8 100644 --- a/src/osm/jp/api/HttpPOST.java +++ b/src/osm/jp/api/HttpPOST.java @@ -81,8 +81,9 @@ } System.out.println(); } - if ((responsecode == 429) || (responsecode == 504)) { + if ((responsecode == 429) || (responsecode == 504) || (responsecode == 500)) { // レスポンスコード[429] レスポンスメッセージ[Too Many Requests] + // レスポンスコード[500] レスポンスメッセージ[Internal server error] // レスポンスコード[504] レスポンスメッセージ[Gateway Timeout] try { TimeUnit.MINUTES.sleep(5); diff --git a/src/osm/jp/coverage/busstop/Busstop.java b/src/osm/jp/coverage/busstop/Busstop.java index 7612e83..4f140fc 100644 --- a/src/osm/jp/coverage/busstop/Busstop.java +++ b/src/osm/jp/coverage/busstop/Busstop.java @@ -30,7 +30,8 @@ // 近くのバス停を探す範囲(バス停を中心としたNEER×2m四方の領域 static final int NEER = 150; // 150m(0.15km) - static boolean update = false; + static boolean update = false; // '-update'オプション postgisデータの更新を行う + static boolean noget = false; // '-noget'オプション OSM既存データのGETを行わない public static SimpleDateFormat timeStampFmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); @@ -53,6 +54,9 @@ if (args[i].equals("-update")) { Busstop.update = true; } + if (args[i].equals("-noget")) { + Busstop.noget = true; + } } // HSQLディレクトリがなければ作る @@ -62,7 +66,6 @@ } Connection con = DatabaseTool.openDb("database"); - Busstop.initDb(con); try { /** @@ -70,8 +73,11 @@ * OSM OverPassAPI を使って、既存のOSMバス停のデータを取得して、「existing.xml」に出力する * --> 'existing.xml' */ - File existingFile = new File("existing.xml"); - getJapanCapabilities(con, existingFile); + if (Busstop.update && !Busstop.noget) { + Busstop.initDb(con); + File existingFile = new File("existing.xml"); + getJapanCapabilities(con, existingFile); + } /** * 都道府県ごとのGMLディレクトリの処理 @@ -150,7 +156,7 @@ continue; } - Busstop.clearDb(con); + //Busstop.clearDb(con); if (!Busstop.update) { inputFile(con, iFile, areacode); }