巨大森林を分割する
Revisão | 3c1cddc71d7356bb3fe149a169ab7d8444c9713f (tree) |
---|---|
Hora | 2013-08-19 23:30:18 |
Autor | hayashi.yuu <hayashi.yuu@gmai...> |
Commiter | hayashi.yuu |
tekitou
@@ -385,6 +385,16 @@ public class DbBigrelation | ||
385 | 385 | ps6.close(); |
386 | 386 | } |
387 | 387 | |
388 | + public static void swap_NDREF(Connection con, long id, long sourceref, long destinationref) throws SQLException | |
389 | + { | |
390 | + PreparedStatement ps6 = con.prepareStatement("UPDATE NDREF SET ref=? WHERE (idref=? and ref=?)"); | |
391 | + ps6.setLong(1, destinationref); | |
392 | + ps6.setLong(2, id); | |
393 | + ps6.setDouble(3, sourceref); | |
394 | + ps6.executeUpdate(); | |
395 | + ps6.close(); | |
396 | + } | |
397 | + | |
388 | 398 | /** |
389 | 399 | * idref BIGINT member.idref |
390 | 400 | * ref BIGINT member.ref --> way.idref, osmnode.idref |
@@ -102,6 +102,9 @@ public class RelationCutter { | ||
102 | 102 | osmnode.loadTag(con); |
103 | 103 | if (osmnode.tags.size() > 0) { |
104 | 104 | // TAG付きのWAYNODEはWAYから分離させる |
105 | + OsmNode newnode = new OsmNode(osmnode); | |
106 | + DbBigrelation.insert_NODE(con, newnode); | |
107 | + DbBigrelation.swap_NDREF(con, way.idref, osmnode.idref, newnode.idref); | |
105 | 108 | |
106 | 109 | } |
107 | 110 | System.out.println("\tMEMBER=WAY=ND: id="+ osmnode.idref +" ["+ osmnode.lat +" : "+ osmnode.lon +"]"); |