示例#1
0
        public override FeatureList process(Feature input, FilterEnv env)
        {
            FeatureList output = new FeatureList();

            if (transform != null && !transform.Identity())
            {
                foreach (GeoShape shape in input.getShapes())
                {
                    XformVisitor visitor = new XformVisitor();
                    visitor.trans = transform;
                    shape.accept(visitor);
                }
            }

            output.Add(input);
            return(output);

#if TODO
            // resolve the xlate shortcut
            Matrix working_matrix = xform_matrix;

            // TODO: this can go into process(FeatureList) instead of running for every feature..
            if (getTranslateScript() != null)
            {
                ScriptResult r = env.getScriptEngine().run(getTranslateScript(), input, env);
                if (r.isValid())
                {
                    working_matrix = Matrix.translate(r.asVec3());
                }
                else
                {
                    env.getReport().error(r.asString());
                }
            }

            if (working_srs != null || (working_matrix != null && !working_matrix.IsIdentity))
            {
                foreach (GeoShape shape in input.getShapes())
                {
                    if (working_matrix != null && !working_matrix.IsIdentity)
                    {
                        XformVisitor visitor;
                        visitor.mat = working_matrix;
                        shape.accept(visitor);
                    }

                    if (working_srs != null && !working_srs.equivalentTo(env.getInputSRS()))
                    {
                        working_srs.transformInPlace(shape);
                    }
                }
            }

            output.Add(input);
            return(output);
#endif
            throw new NotImplementedException();
        }
        public override FeatureList process(Feature input, FilterEnv env)
        {


            FeatureList output = new FeatureList();
            if (transform != null && !transform.Identity())
            {
                foreach (GeoShape shape in input.getShapes())
                {
                    XformVisitor visitor = new XformVisitor();
                    visitor.trans = transform;
                    shape.accept(visitor);
                }
            }

            output.Add(input);
            return output;
#if TODO
            // resolve the xlate shortcut
            Matrix working_matrix = xform_matrix;

            // TODO: this can go into process(FeatureList) instead of running for every feature..
            if (getTranslateScript() != null)
            {
                ScriptResult r = env.getScriptEngine().run(getTranslateScript(), input, env);
                if (r.isValid())
                    working_matrix = Matrix.translate(r.asVec3());
                else
                    env.getReport().error(r.asString());
            }

            if (working_srs != null || (working_matrix != null && !working_matrix.IsIdentity))
            {
                foreach (GeoShape shape in input.getShapes())
                {
                    if (working_matrix != null && !working_matrix.IsIdentity)
                    {

                        XformVisitor visitor;
                        visitor.mat = working_matrix;
                        shape.accept(visitor);
                    }

                    if (working_srs != null && !working_srs.equivalentTo(env.getInputSRS()))
                    {
                        working_srs.transformInPlace(shape);
                    }
                }
            }

            output.Add(input);
            return output;
#endif
            throw new NotImplementedException();
        }