Beispiel #1
0
        public virtual void run()
        {
            // first check to see whether this cell needs compiling:
            need_to_compile = archive.valid() || !osgDB.fileExists(abs_output_uri);

            output_status = CellCompiler.OutputStatus.OUTPUT_UNKNOWN;
            //has_drawables = false;

            if (need_to_compile)
            {
                // Compile the cell:
                FeatureLayerCompiler.run();

                // Write the resulting node graph to disk, first ensuring that the output folder exists:
                // TODO: consider whether this belongs in the runSynchronousPostProcess() method
                if (getResult().isOK())
                {
                    if (getResultNode() != null && GeomUtils.hasDrawables(getResultNode()))
                    {
                        output_status = CellCompiler.OutputStatus.OUTPUT_NON_EMPTY;
                    }
                    else
                    {
                        output_status = CellCompiler.OutputStatus.OUTPUT_EMPTY;
                    }
                }
            }
            else
            {
                result        = FilterGraphResult.ok();
                output_status = CellCompiler.OutputStatus.OUTPUT_ALREADY_EXISTS;
                //has_drawables = true;
            }
        }
        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();
            }
        }
Beispiel #3
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");
                    }
                }
            }
        }