Пример #1
0
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();
}
Пример #2
0
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;
}
Пример #3
0
    bool operator()(const TePoint& p1, const TePoint& p2) const
    {
        if(p1.location().x_ < p2.location().x_)
            return true;
        else if(p1.location().x_ > p2.location().x_)
            return false;

        if(p1.location().y_ < p2.location().y_)
            return true;
        else if(p1.location().y_ > p2.location().y_)
            return false;

        return false;
    }