当前位置: 首页>>代码示例>>C++>>正文


C++ TeDatabasePortal::getProjection方法代码示例

本文整理汇总了C++中TeDatabasePortal::getProjection方法的典型用法代码示例。如果您正苦于以下问题:C++ TeDatabasePortal::getProjection方法的具体用法?C++ TeDatabasePortal::getProjection怎么用?C++ TeDatabasePortal::getProjection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TeDatabasePortal的用法示例。


在下文中一共展示了TeDatabasePortal::getProjection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateDB400To412

bool updateDB400To412(TeDatabase* db, string& errorMessage)
{
// ----- create the datum table
	if(!db->createDatumTable())
	{
		errorMessage = "Error creating the datum table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

// ----- create the SRS table
	if(!db->createSRSTable())
	{
		errorMessage = "Error creating the SRS table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

// ----- populate the datum table with pre-defined datums and ellipsoids
	db->populateDatumTable();

// ----- change te_projection table: removed the columns associated with datum
	if(!db->deleteColumn("te_projection", "radius"))
	{
		errorMessage = "Error removing the column radius from te_projection table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

	if(!db->deleteColumn("te_projection", "flattening"))
	{
		errorMessage = "Error removing the column flattening from te_projection table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

	if(!db->deleteColumn("te_projection", "dx"))
	{
		errorMessage = "Error removing the column dx from te_projection table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

	if(!db->deleteColumn("te_projection", "dy"))
	{
		errorMessage = "Error removing the column dy from te_projection table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

	if(!db->deleteColumn("te_projection", "dz"))
	{
		errorMessage = "Error removing the column dz from te_projection table.\n";
		errorMessage += db->errorMessage();
		return false;
	}
// ----- END: change te_projection table: removed the columns associated with datum

// ----- relations
	if(!db->createRelation("fk_proj_datum_name", "te_projection", "datum", "te_datum", "name", false))
	{
		errorMessage = "Error creating foreign key in the projection table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

	if(!db->createRelation("fk_srs_proj_id", "te_srs", "projection_id", "te_projection", "projection_id", true))
	{
		errorMessage = "Error creating foreign key in the srs table.\n";
		errorMessage += db->errorMessage();
		return false;
	}

// ----- populate te_srs table
	TeDatabasePortal* portal = db->getPortal();
	if(!portal)
	{
		errorMessage = "Error getting the database portal";
		return false;
	}

	std::string sql = "SELECT te_projection.*, te_datum.radius, te_datum.flattening, te_datum.dx, te_datum.dy, te_datum.dz ";
	sql += "FROM te_projection LEFT JOIN te_datum ON te_projection.datum = te_datum.name ";

	if (!portal->query(sql))
		return false;

	while(portal->fetchRow())
	{
		TeProjection* proj = 0;
		portal->getProjection(&proj);
		if(proj)
			db->insertSRSId(proj, proj->epsgCode());
		delete proj;
	}

	portal->freeResult();
	delete portal;

	return true;
//.........这里部分代码省略.........
开发者ID:Universefei,项目名称:Terralib-analysis,代码行数:101,代码来源:TeUpdateDBVersion.cpp


注:本文中的TeDatabasePortal::getProjection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。