| |
---|
| | } |
---|
| | |
---|
| | 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 { |
---|
| | |
---|
| |
---|
| | String nameStr = rset.getString("name"); |
---|
| | 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()) { |
---|
| | String tags = rset8.getString("tags"); |
---|
| |
---|
| | |
---|
| | if (((point & POINT_FIXME) != 0) && fixme) { |
---|
| | score = 1; |
---|
| | } |
---|
| | if (((point & POINT_BUS) != 0) && !busYes) { |
---|
| | if (((point & POINT_BUS_NO) != 0) && !busYes) { |
---|
| | score = 0; |
---|
| | } |
---|
| | } |
---|
| | |
---|
| |
---|
| | double lat = (maxlat + minlat) / 2; |
---|
| | 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("")) { |
---|
| | score = 1; |
---|
| |
---|
| | |