diff --git a/src/osm/jp/api/HttpPOST.java b/src/osm/jp/api/HttpPOST.java index b091080..a29beca 100644 --- a/src/osm/jp/api/HttpPOST.java +++ b/src/osm/jp/api/HttpPOST.java @@ -193,13 +193,19 @@ pw.print(text); } + public static final int POINT_NO = 0; // 評価ポイント無し→ score=50 + public static final int POINT_FIXME = 1; // 評価ポイント無し→ score=50 + public static final int POINT_BRAND = 2; // 評価ポイント|brand=null → score=1 + public static final int POINT_NAME = 4; // 評価ポイント|name=null → score=1 + /** - * - * @param con - * @param point 1: 'brand' 2:'name' - * @throws FileNotFoundException + * File(HttpPOST.EXIST_FILE)を読み取って、データベースに反映させる。
+ * その際に、OSMノードを評価し、scoreを算定する + * @param con 反映先のデータベースコネクタ(HSQLDB) + * @param point 評価ポイント[POINT_NO|POINT_BRAND|POINT_NAME] 1: 'brand' 2:'name' + * @throws FileNotFoundException File(HttpPOST.EXIST_FILE)が存在しない * @throws ClassNotFoundException - * @throws SQLException + * @throws SQLException データベースエラー * @throws IOException * @throws ParserConfigurationException * @throws SAXException @@ -368,13 +374,13 @@ double lon = (maxlon + minlon) / 2; score = 50; - if ((point == 2) && nameStr.equals("")) { + if (((point & POINT_NAME) != 0) && nameStr.equals("")) { score = 1; } - if ((point == 1) && brandStr.equals("")) { + if (((point & POINT_BRAND) != 0) && brandStr.equals("")) { score = 1; } - if (!fixmeStr.equals("")) { + if (((point & POINT_FIXME) != 0) && !fixmeStr.equals("")) { score = 1; } @@ -455,13 +461,13 @@ } score = 50; - if ((point == 2) && nameStr.equals("")) { + if (((point & POINT_NAME) != 0) && nameStr.equals("")) { score = 1; } - if ((point == 1) && brandStr.equals("")) { + if (((point & POINT_BRAND) != 0) && brandStr.equals("")) { score = 1; } - if (!fixmeStr.equals("")) { + if (((point & POINT_FIXME) != 0) && !fixmeStr.equals("")) { score = 1; } diff --git a/src/osm/jp/coverage/busstop/DbExistBusstop.java b/src/osm/jp/coverage/busstop/DbExistBusstop.java index 7c46cfe..91e6d75 100644 --- a/src/osm/jp/coverage/busstop/DbExistBusstop.java +++ b/src/osm/jp/coverage/busstop/DbExistBusstop.java @@ -111,7 +111,7 @@ queryText.append(");"); queryText.append("out;"); HttpPOST.getQuery(queryText.toString()); - HttpPOST.readExistingFile(conHsql, 2); + HttpPOST.readExistingFile(conHsql, HttpPOST.POINT_NAME & HttpPOST.POINT_FIXME); } } } \ No newline at end of file diff --git a/src/osm/jp/coverage/fuel/DbExist.java b/src/osm/jp/coverage/fuel/DbExist.java index b0e43b0..b424786 100644 --- a/src/osm/jp/coverage/fuel/DbExist.java +++ b/src/osm/jp/coverage/fuel/DbExist.java @@ -93,7 +93,7 @@ queryText.append(");"); queryText.append("out;"); HttpPOST.getQuery(queryText.toString()); - HttpPOST.readExistingFile(con, 1); + HttpPOST.readExistingFile(con, HttpPOST.POINT_BRAND & HttpPOST.POINT_FIXME); } }