• R/O
  • HTTP
  • SSH
  • HTTPS

標籤
無標籤

Frequently used words (click to add to your profile)

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

巨大森林を分割する


File Info

修訂. d657905b22beef4786d7ef00164f20023c50be58
大小 1,841 bytes
時間 2013-07-28 20:55:44
作者 hayashi.yuu
Log Message

分割点でWAYを分割

Content

package osm.jp;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * 
 * <way id='161839750' 
 * 		timestamp='2012-05-02T03:51:48Z' 
 * 		uid='621319' 
 * 		user='hayashi' 
 * 		visible='true' 
 * 		version='1' 
 * 		changeset='11475930'>
 * 
 * @author hayashi
 */
public class Way {
	public long idref = 0L;
	public String timestampStr = "";
	public long uid = 0L;
	public String userStr = "";
	public String visibleStr = "";
	public String versionStr = "";
	public long changeset = 0L;
	
	ArrayList<Tag> tags = new ArrayList<Tag>();
	ArrayList<OsmNode> waynodes = new ArrayList<OsmNode>();
	
	public Way() {
		this.idref = 0L;
		this.timestampStr = "";
		this.uid = 0L;
		this.userStr = "";
		this.visibleStr = "";
		this.versionStr = "";
		this.changeset = 0L;
	}
	
	public Way(Way source) {
		this.idref = source.idref;
		this.timestampStr = source.timestampStr;
		this.uid = source.uid;
		this.userStr = source.userStr;
		this.visibleStr = source.visibleStr;
		this.versionStr = source.versionStr;
		this.changeset = source.changeset;
		
		this.tags = new ArrayList<Tag>();
		Iterator<Tag> itag = tags.iterator();
		while (itag.hasNext()) {
			Tag tag = itag.next();
			this.tags.add(tag);
		}
		
		this.waynodes = new ArrayList<OsmNode>();
		Iterator<OsmNode> inode = waynodes.iterator();
		while (inode.hasNext()) {
			OsmNode waynode = inode.next();
			this.waynodes.add(waynode);
		}
	}
	
	public String show() {
		return ("id='"+ idref +"' timestamp='"+ timestampStr +"' uid='"+ uid +"' user='"+ userStr +"' visible='"+ visibleStr +"' version='"+ versionStr +"' changeset='"+ changeset +"'");
	}

	public int loadTag(Connection con) throws SQLException {
		tags = new ArrayList<Tag>();
		DbBigrelation.getTags(con, tags, this.idref);
		return tags.size();
	}
}