Package org.geotools.data.transform

Examples of org.geotools.data.transform.Definition


            final AttributeType type = attribute.getType();
            final Class<?> binding = type.getBinding();
            String attributeName = remap(originalAttribute);

            // Create the definition to map the original attribute to the Oracle specific one
            final Definition definition = new Definition(originalAttribute, ECQL.toExpression(attributeName), binding);
            definitions.add(definition);
            definitionsMapping.put(attribute.getName(), definition);
        }
        remapFeatureType();
    }
View Full Code Here


        // Loop over the attribute descriptors
        for (AttributeDescriptor descriptor : descriptors) {

            // Get main properties (name and type)
            Name name = descriptor.getName();
            Definition definition = definitionsMapping.get(name);
            AttributeType type = descriptor.getType();
            if (type instanceof GeometryType) {
                coordinateReferenceSystem = ((GeometryType) type).getCoordinateReferenceSystem();
                tb.add(definition.getExpression().toString(), definition.getBinding(), coordinateReferenceSystem);
            } else {
                tb.add(definition.getExpression().toString(), definition.getBinding());
            }
        }
        oracleFeatureType = tb.buildFeatureType();
    }
View Full Code Here

        STATES = pds.getFeatureSource("states");
    }
   
    SimpleFeatureSource transformWithSelection() throws IOException {
        List<Definition> definitions = new ArrayList<Definition>();
        definitions.add(new Definition("the_geom"));
        definitions.add(new Definition("state_name"));
        definitions.add(new Definition("persons"));

        SimpleFeatureSource transformed = TransformFactory.transform(STATES, "states_mini", definitions);
        return transformed;
    }
View Full Code Here

        return transformed;
    }

    SimpleFeatureSource transformWithRename() throws Exception {
        List<Definition> definitions = new ArrayList<Definition>();
        definitions.add(new Definition("geom", ECQL.toExpression("the_geom")));
        definitions.add(new Definition("name", ECQL.toExpression("state_name")));
        definitions.add(new Definition("people", ECQL.toExpression("persons")));

        SimpleFeatureSource transformed = TransformFactory.transform(STATES, "usa", definitions);
        return transformed;
    }
View Full Code Here

        return transformed;
    }

    SimpleFeatureSource transformWithExpressions() throws Exception {
        List<Definition> definitions = new ArrayList<Definition>();
        definitions.add(new Definition("geom", ECQL.toExpression("buffer(the_geom, 1)")));
        definitions.add(new Definition("name", ECQL.toExpression("strToLowercase(state_name)")));
        definitions.add(new Definition("total", ECQL.toExpression("male + female")));
        definitions.add(new Definition("logp", ECQL.toExpression("log(persons)")));

        SimpleFeatureSource transformed = TransformFactory.transform(STATES, "bstates", definitions);
        return transformed;
    }
View Full Code Here

        return transformed;
    }
   
    SimpleFeatureSource transformWithExpressionsWithEmptySource() throws Exception {
        List<Definition> definitions = new ArrayList<Definition>();
        definitions.add(new Definition("geom", ECQL.toExpression("buffer(the_geom, 1)")));
        definitions.add(new Definition("name", ECQL.toExpression("strToLowercase(state_name)")));
        definitions.add(new Definition("total", ECQL.toExpression("male + female")));
        definitions.add(new Definition("logp", ECQL.toExpression("log(persons)")));
       
        ListFeatureCollection fc = new ListFeatureCollection(STATES.getSchema());
        SimpleFeatureSource emptySource = DataUtilities.source(fc);

        SimpleFeatureSource transformed = TransformFactory.transform(emptySource, "bstates", definitions);
View Full Code Here

        STATES = pds.getFeatureSource("states");
    }

    SimpleFeatureSource transformWithPartialTransform() throws Exception {
        List<Definition> definitions = new ArrayList<Definition>();
        definitions.add(new Definition("geom", ECQL.toExpression("buffer(the_geom, 1)")));
        definitions.add(new Definition("name", ECQL.toExpression("strToLowercase(state_name)")));
        definitions.add(new Definition("total", ECQL.toExpression("male + female")));
        definitions.add(new Definition("people", ECQL.toExpression("persons")));

        SimpleFeatureSource transformed = TransformFactory.transform(STATES, "bstates", definitions);
        return transformed;
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.transform.Definition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.