public virtual void run()
        {
            if (layer == null)
            {
                result = FilterGraphResult.error("Illegal: null feature layer");
            }
            else if (filter_graph == null)
            {
                result = FilterGraphResult.error("Illegal: null filter graph");
            }
            else if (env == null)
            {
                result = FilterGraphResult.error("Illegal: null filter environment");
            }
            else
            {
                env.getReport().markStartTime();

                // ensure the input SRS matches that of the layer:
                env.setInputSRS(layer.getSRS());

                // retrieve the features in the given extent:
                FeatureCursor cursor = layer.getCursor(env.getExtent());

                // and compile the filter graph:
                osg.Group temp = null;
                result      = filter_graph.computeNodes(cursor, env, temp);
                result_node = temp;

                env.getReport().markEndTime();
            }
        }
Esempio n. 2
0
        public virtual void runSynchronousPostProcess(Report report)
        {
            if (need_to_compile)
            {
                if (!getResult().isOK())
                {
                    // osgGIS.notice() << getName() << " failed to compile: " << getResult().getMessage() << std.endl;
                    return;
                }

                if (output_status == CellCompiler.OutputStatus.OUTPUT_EMPTY) //!getResultNode() || !has_drawables )
                {
                    // osgGIS.info() << getName() << " resulted in no geometry" << std.endl;
                    result_node = null;
                    return;
                }

                if (packager.valid())
                {
                    // TODO: we should probably combine the following two calls into one:

                    // update any texture/model refs in preparation for packaging:
                    packager.rewriteResourceReferences(getResultNode());

                    // copy resources to their final destination
                    packager.packageResources(env.getResourceCache(), report);

                    // write the node data itself
                    osg.Node node_to_package = getResultNode();

                    if (!packager.packageNode(node_to_package.get(), abs_output_uri)) //, env.getCellExtent(), min_range, max_range ) )
                    {
                        //osgGIS.warn() << getName() << " failed to package node to output location" << std.endl;
                        result = FilterGraphResult.error("Cell built OK, but failed to deploy to disk/archive");
                    }
                }
            }
        }