diff --git a/src/osm/jp/api/Osmdb.java b/src/osm/jp/api/Osmdb.java index 5392729..cd24c04 100644 --- a/src/osm/jp/api/Osmdb.java +++ b/src/osm/jp/api/Osmdb.java @@ -76,9 +76,9 @@ public static final int POINT_NO = 0; // 評価ポイント無し→ score=50 public static final int POINT_FIXME = 1; // 評価ポイント|!(fixme=null) → score=1 - public static final int POINT_BRAND = 2; // 評価ポイント|brand=null → score=1 - public static final int POINT_NAME = 4; // 評価ポイント|name=null → score=1 - public static final int POINT_BUS = 8; // 評価ポイント|!(bus=yes) → score=0 + public static final int POINT_NO_BRAND = 2; // 評価ポイント|brand=null → score=1 + public static final int POINT_NO_NAME = 4; // 評価ポイント|name=null → score=1 + public static final int POINT_BUS_NO = 8; // 評価ポイント|!(bus=yes) → score=0 public int importExistingNode(Connection hsqldb, Connection osmdb, ResultSet rset, int point) throws IOException, SQLException { @@ -91,16 +91,16 @@ String fixmeStr = ""; int score = 50; - if (((point & POINT_BRAND) != 0) && isNull(brandStr)) { + if (((point & POINT_NO_BRAND) != 0) && isNull(brandStr)) { score = 1; } - if (((point & POINT_NAME) != 0) && isNull(nameStr)) { + if (((point & POINT_NO_NAME) != 0) && isNull(nameStr)) { score = 1; } boolean fixme = false; boolean busYes = false; - if (((point & (POINT_FIXME | POINT_BUS)) != 0)) { + if (((point & (POINT_FIXME | POINT_BUS_NO)) != 0)) { PreparedStatement ps8 = osmdb.prepareStatement("SELECT * FROM planet_osm_nodes where id='"+ osmidStr +"'"); try (ResultSet rset8 = ps8.executeQuery()) { while (rset8.next()) { @@ -142,7 +142,7 @@ if (((point & POINT_FIXME) != 0) && fixme) { score = 1; } - if (((point & POINT_BUS) != 0) && !busYes) { + if (((point & POINT_BUS_NO) != 0) && !busYes) { score = 0; } } @@ -298,10 +298,10 @@ double lon = (maxlon + minlon) / 2; int score = 50; - if (((point & POINT_BRAND) != 0) && brandStr.equals("")) { + if (((point & POINT_NO_BRAND) != 0) && brandStr.equals("")) { score = 1; } - if (((point & POINT_NAME) != 0) && nameStr.equals("")) { + if (((point & POINT_NO_NAME) != 0) && nameStr.equals("")) { score = 1; } if (((point & POINT_FIXME) != 0) && !fixmeStr.equals("")) { diff --git a/src/osm/jp/coverage/busstop/DbExistBusstop.java b/src/osm/jp/coverage/busstop/DbExistBusstop.java index eed4a9a..9d1578b 100644 --- a/src/osm/jp/coverage/busstop/DbExistBusstop.java +++ b/src/osm/jp/coverage/busstop/DbExistBusstop.java @@ -86,7 +86,7 @@ // 通常 → 50ポイント // NAMEなし → 1ポイント // FIXMEあり → 1ポイント - readExisting(conHsql, null, POINT_NAME | POINT_FIXME); + readExisting(conHsql, null, POINT_NO_NAME | POINT_FIXME); } // ノード: 厚木ナイロン (1995040609) 場所: 35.4433312, 139.3932098 public_transport=stop_position,bus=yes @@ -139,7 +139,7 @@ PreparedStatement ps = osmdb.prepareStatement(sql + ",ST_Y(ST_Transform(way,4326)) as lat,ST_X(ST_Transform(way,4326)) as lon from planet_osm_point " + whereText.toString()); try (ResultSet rset1 = ps.executeQuery()) { while (rset1.next()) { - counter += importExistingNode(hsqldb, osmdb, rset1, point | POINT_BUS); + counter += importExistingNode(hsqldb, osmdb, rset1, point | POINT_BUS_NO); } } diff --git a/src/osm/jp/coverage/fuel/DbExist.java b/src/osm/jp/coverage/fuel/DbExist.java index aad5ac9..8016760 100644 --- a/src/osm/jp/coverage/fuel/DbExist.java +++ b/src/osm/jp/coverage/fuel/DbExist.java @@ -101,14 +101,14 @@ // 通常 → 50ポイント // BRANDなし → 1ポイント // FIXMEあり → 1ポイント - readExisting(hsqldb, "where amenity='fuel'", POINT_BRAND | POINT_FIXME); - readExistingSub(hsqldb, "disused:amenity", "fuel", POINT_BRAND | POINT_FIXME); - readExistingSub(hsqldb, "abandoned:amenity", "fuel", POINT_BRAND | POINT_FIXME); - readExistingSub(hsqldb, "demolished:amenity", "fuel", POINT_BRAND | POINT_FIXME); - readExistingSub(hsqldb, "historic:amenity", "fuel", POINT_BRAND | POINT_FIXME); - readExistingSub(hsqldb, "was:amenity", "fuel", POINT_BRAND | POINT_FIXME); - readExistingSub(hsqldb, "removed:amenity", "fuel", POINT_BRAND | POINT_FIXME); - readExistingSub(hsqldb, "no:amenity", "fuel", POINT_BRAND | POINT_FIXME); + readExisting(hsqldb, "where amenity='fuel'", POINT_NO_BRAND | POINT_FIXME); + readExistingSub(hsqldb, "disused:amenity", "fuel", POINT_NO); + //readExistingSub(hsqldb, "abandoned:amenity", "fuel", POINT_NO); + //readExistingSub(hsqldb, "demolished:amenity", "fuel", POINT_NO); + //readExistingSub(hsqldb, "historic:amenity", "fuel", POINT_NO); + //readExistingSub(hsqldb, "was:amenity", "fuel", POINT_NO); + //readExistingSub(hsqldb, "removed:amenity", "fuel", POINT_NO); + //readExistingSub(hsqldb, "no:amenity", "fuel", POINT_NO); } /**