本文整理汇总了C#中Terrain.getExplicitSRS方法的典型用法代码示例。如果您正苦于以下问题:C# Terrain.getExplicitSRS方法的具体用法?C# Terrain.getExplicitSRS怎么用?C# Terrain.getExplicitSRS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terrain
的用法示例。
在下文中一共展示了Terrain.getExplicitSRS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getTerrainData
/*** Statics ********************************************************/
static bool getTerrainData(Terrain terrain,
out osg.Node out_terrain_node,
out SpatialReference out_terrain_srs,
out GeoExtent out_terrain_extent)
{
if (terrain != null)
{
if (!string.IsNullOrEmpty(terrain.getURI()))
{
out_terrain_node = osgDB.readNodeFile(terrain.getAbsoluteURI());
}
// first check for an explicity defined SRS:
out_terrain_srs = terrain.getExplicitSRS();
if (out_terrain_srs != null && out_terrain_srs.isGeographic())
{
// and make it geocentric if necessary..
out_terrain_srs = Registry.SRSFactory().createGeocentricSRS(out_terrain_srs.get());
}
if (out_terrain_node != null)
{
// if the SRS wasn't explicit, try to read it from the scene graph:
if (out_terrain_srs == null)
{
out_terrain_srs = Registry.SRSFactory().createSRSfromTerrain(out_terrain_node.get());
}
//osgGIS.notice()
// << "Loaded TERRAIN from \"" << terrain.getAbsoluteURI() << "\", SRS = "
// << (out_terrain_srs != null? out_terrain_srs.getName() : "unknown")
// << std.endl;
}
else if (!string.IsNullOrEmpty(terrain.getURI()))
{
//osgGIS.warn()
// << "Unable to load data for terrain \""
// << terrain.getName() << "\"."
// << std.endl;
return false;
}
}
out_terrain_extent = new GeoExtent(-180, -90, 180, 90,
Registry.instance().getSRSFactory().createWGS84());
return true;
}