• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

巨大森林を分割する


Commit MetaInfo

修訂3c1cddc71d7356bb3fe149a169ab7d8444c9713f (tree)
時間2013-08-19 23:30:18
作者hayashi.yuu <hayashi.yuu@gmai...>
Commiterhayashi.yuu

Log Message

tekitou

Change Summary

差異

--- a/src/osm/jp/DbBigrelation.java
+++ b/src/osm/jp/DbBigrelation.java
@@ -385,6 +385,16 @@ public class DbBigrelation
385385 ps6.close();
386386 }
387387
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+
388398 /**
389399 * idref BIGINT member.idref
390400 * ref BIGINT member.ref --> way.idref, osmnode.idref
--- a/src/osm/jp/RelationCutter.java
+++ b/src/osm/jp/RelationCutter.java
@@ -102,6 +102,9 @@ public class RelationCutter {
102102 osmnode.loadTag(con);
103103 if (osmnode.tags.size() > 0) {
104104 // 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);
105108
106109 }
107110 System.out.println("\tMEMBER=WAY=ND: id="+ osmnode.idref +" ["+ osmnode.lat +" : "+ osmnode.lon +"]");