bool TeSQLitePortal::fetchGeometry(TePoint& geom, const unsigned int& initIndex)
{
	errorMessage_ = "";
	
	TeCoord2D pt(getDouble(initIndex + 2), getDouble(initIndex + 3)); 

	geom.add(pt);
	geom.geomId(getInt(initIndex + 0));
	geom.objectId(string(getData(initIndex + 1)));

	return fetchRow();
}
bool TeSQLite::insertPoint(const string& table, TePoint &p)
{
	std::string q = "INSERT INTO " + table + "(object_id, x, y)";
	q += " VALUES(";
	q += "'" + escapeSequence(p.objectId()) + "',";
	q += Te2String(p.location().x_) + ",";
	q += Te2String(p.location().y_) + ")";
	
	if(execute(q) == false)
	{
		return false;
	}

	//int newId = getMaxValue(this, table, "geom_id");
	int newId = getLastInsertedSerial();
	if(newId >= 0)
	{
		p.geomId(newId);
	}
	return true;
}