本文整理汇总了C#中Source.getParentSource方法的典型用法代码示例。如果您正苦于以下问题:C# Source.getParentSource方法的具体用法?C# Source.getParentSource怎么用?C# Source.getParentSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Source
的用法示例。
在下文中一共展示了Source.getParentSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: encodeSource
static XmlElement encodeSource(XmlDocument doc, Source source)
{
XmlElement e = null;
if (source != null)
{
e = doc.CreateElement("source");
e.SetAttribute("name", source.getName());
e.SetAttribute("type", (source.getType() == Source.SourceType.TYPE_RASTER ? "raster" : "feature"));
if (source.getFilterGraph() != null)
e.SetAttribute("graph", source.getFilterGraph().getName());
if (source.getParentSource() != null)
e.SetAttribute("parent", source.getParentSource().getName());
e.AppendChild(encodeURI(doc, source.getURI()));
}
return e;
}
示例2: build
protected bool build(Source source, Session session)
{
//osgGIS.notice() << "Building source " << source.getName() << std.endl;
// only need to build intermediate sources.
if (!source.isIntermediate())
{
//osgGIS.info() << "...source " << source.getName() << " does not need building (not intermediate)." << std.endl;
return true;
}
Source parent = source.getParentSource();
if (parent == null)
{
//osgGIS.warn() << "...ERROR: No parent source found for intermediate source \"" << source.getName() << "\"" << std.endl;
return false;
}
// check whether a rebuild is required:
if (parent.getTimeLastModified() < source.getTimeLastModified())
{
//osgGIS.info() << "...source " << source.getName() << " does not need building (newer than parent)." << std.endl;
return true;
}
// build it's parent first:
if (!build(parent, session))
{
//osgGIS.warn() << "...ERROR: Failed to build source \"" << parent.getName() << "\", parent of source \"" << source.getName() << "\"" << std.endl;
return false;
}
// validate the existence of a filter graph:
FilterGraph graph = source.getFilterGraph();
if (graph == null)
{
//osgGIS.warn() << "...ERROR: No filter graph set for intermediate source \"" << source.getName() << "\"" << std.endl;
return false;
}
// establish a feature layer for the parent source:
FeatureLayer feature_layer = Registry.instance().createFeatureLayer(parent.getAbsoluteURI());
if (feature_layer == null)
{
//osgGIS.warn() << "...ERROR: Cannot access source \"" << source.getName() << "\"" << std.endl;
return false;
}
//TODO: should we allow terrains for a source compile?? No. Because we would need to transform
// the source into terrain SRS space, which we do not want to do until we're building nodes.
// initialize a source data compiler. we use a temporary session because this source build
// is unrelated to the current "master" build. If we used the same session, the new feature
// store would hang around and not get properly closed out for use in the next round.
Session temp_session = session.derive();
FilterEnv source_env = temp_session.createFilterEnv();
FeatureStoreCompiler compiler = new FeatureStoreCompiler(feature_layer, graph);
if (!compiler.compile(source.getAbsoluteURI(), source_env))
{
//osgGIS.warn() << "...ERROR: failure compiling source \"" << source.getName() << "\"" << std.endl;
return false;
}
//osgGIS.notice() << "...done compiling source \"" << source.getName() << "\"" << std.endl;
return true;
}