Exemplo n.º 1
0
        public bool testSources()
        {
            foreach (Source i in getSources())
            {
                Source source = i;

                //osgGIS.notify(osg.NOTICE) << "Source: \"" << source.getName() << "\":" << std.endl;

                if (source.isIntermediate())
                {
                    // osgGIS.notify(osg.WARN) << "Source is intermediate; skipping." << std.endl;
                    continue;
                }

                object store = null;

                if (source.getType() == Source.SourceType.TYPE_FEATURE)
                {
                    store = Registry.instance().getFeatureStoreFactory().connectToFeatureStore(source.getAbsoluteURI());
                }
                else if (source.getType() == Source.SourceType.TYPE_RASTER)
                {
                    store = Registry.instance().getRasterStoreFactory().connectToRasterStore(source.getAbsoluteURI());
                }

                if (store == null)
                {
                    //osgGIS.notify(osg.WARN) << "*** FAILED TO CONNECT TO " << source.getAbsoluteURI() << std.endl;
                }

                //osgGIS.notify(osg.NOTICE) << std.endl;
            }

            return(true);
        }
Exemplo n.º 2
0
        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);
        }