Ejemplo n.º 1
0
        protected virtual uint queueTasks(Profile profile, TaskManager task_man)
        {
            uint level = 0;

            foreach (MapLayerLevelOfDetail i in map_layer.getLevels())
            {
                MapLayerLevelOfDetail level_def = i;

                string s = level.ToString();

                FilterEnv cell_env = getSession().createFilterEnv();
                cell_env.setExtent(map_layer.getAreaOfInterest()); //GeoExtent.infinite() );
                cell_env.setTerrainNode(getTerrainNode());
                cell_env.setTerrainSRS(getTerrainSRS());
                foreach (Property prop in level_def.getEnvProperties())
                {
                    cell_env.setProperty(prop);
                }

                Task task = new CellCompiler(s,
                                             s,
                                             level_def.getFeatureLayer(),
                                             level_def.getFilterGraph(),
                                             level_def.getMinRange(),
                                             level_def.getMaxRange(),
                                             cell_env,
                                             null, null, null);

                task_man.queueTask(task);
            }
            return(level);
        }
Ejemplo n.º 2
0
        protected Task createQuadKeyTask(QuadKey key)
        {
            // construct a filter environment template to use for all tasks:
            FilterEnv cell_env = getSession().createFilterEnv();

            cell_env.setTerrainNode(getTerrainNode());
            cell_env.setTerrainSRS(getTerrainSRS());

            string abs_path = createAbsPathFromTemplate("g" + key.toString());

            Task task = null;

            MapLayerLevelOfDetail def = getDefinition(key.createParentKey(), map_layer);

            if (def != null)
            {
                cell_env.setInputSRS(def.getFeatureLayer().getSRS());
                cell_env.setExtent(map_layer.getAreaOfInterest().getSRS().transform(key.getExtent()));
                cell_env.setProperty(new Property("compiler.cell_id", key.toString()));
                foreach (Property i in def.getEnvProperties())
                {
                    cell_env.setProperty(i);
                }

                task = new CellCompiler(
                    key.toString(),
                    abs_path,
                    def.getFeatureLayer(),
                    def.getFilterGraph(),
                    def.getMinRange(),
                    def.getMaxRange(),
                    cell_env,
                    def.getResourcePackager() ? def.getResourcePackager() : resource_packager.get(),
                    getArchive(),
                    def.getUserData());

                // osgGIS.info()
                //    << "Task: Key = " << key.toString() << ", LOD = " << key.getLOD() << ", Extent = " << key.getExtent().toString()
                //    << " (w=" << key.getExtent().getWidth() << ", h=" << key.getExtent().getHeight() << ")"
                //    << std.endl;
            }

            return(task);
        }