Package org.opengis.feature.type

Examples of org.opengis.feature.type.FeatureTypeFactory


     * </ul>
     *
     * @return
     */
    public static FeatureType createComplexWaterQualityType() {
        FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl();
        TypeBuilder builder = new TypeBuilder(tfac);

        FeatureType wq_plusType;

        AttributeType detdesc = builder.name("determinand_description").bind(String.class)
View Full Code Here


        return wq_plusType;
    }

    public static FeatureType createComplexWaterSampleType() {
        FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl();
        TypeBuilder builder = new TypeBuilder(tfac);

        FeatureType sampleType;

        AttributeType parameter = builder.name("parameter").bind(String.class).attribute();
View Full Code Here

        Name sourceTypeName = WATERSAMPLE_TYPENAME;
        final FeatureSource<SimpleFeatureType, SimpleFeature> wsSource = simpleStore
                .getFeatureSource(sourceTypeName);

        FeatureType targetType = createComplexWaterQualityType();
        FeatureTypeFactory tf = new UniqueNameFeatureTypeFactoryImpl();
        AttributeDescriptor targetFeature = tf.createAttributeDescriptor(targetType, targetType
                .getName(), 0, Integer.MAX_VALUE, true, null);

        List mappings = new LinkedList();
        Expression id;
        Expression source;
View Full Code Here

    @Before
    public void setUp() throws Exception {
        MemoryDataStore ds = createWaterSampleTestFeatures();
        targetType = TestData.createComplexWaterSampleType();
        FeatureTypeFactory tf = new UniqueNameFeatureTypeFactoryImpl();
        AttributeDescriptor targetFeature = tf.createAttributeDescriptor(targetType, targetType
                .getName(), 0, Integer.MAX_VALUE, true, null);
        targetName = targetFeature.getName();
        List mappings = TestData.createMappingsColumnsAndValues(targetFeature);

        Name sourceName = TestData.WATERSAMPLE_TYPENAME;
View Full Code Here

        assertEquals(multiLeafDesc, ex.evaluate(fType));
                      
    }

    public static FeatureType createFeatureType() {
        FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl();
        Name fName = new NameImpl(EG, "complexFeatureType");

        Collection<PropertyDescriptor> schema = new ArrayList<PropertyDescriptor>();

        // add simple attribute
        AttributeType attType = new AttributeTypeImpl(SIMPLE_ATTRIBUTE, String.class, false, false,
                Collections.EMPTY_LIST, null, null);

        AttributeDescriptor attDesc = new AttributeDescriptorImpl(attType, SIMPLE_ATTRIBUTE, 0, 1,
                true, null);

        schema.add(attDesc);

        // build nested attributes

        Collection<PropertyDescriptor> rootProperties = new ArrayList<PropertyDescriptor>();

        attType = new AttributeTypeImpl(SINGLE_LEAF_ATTRIBUTE, String.class, false, false,
                Collections.EMPTY_LIST, null, null);
        attDesc = new AttributeDescriptorImpl(attType, SINGLE_LEAF_ATTRIBUTE, 0, 1, true, null);
        rootProperties.add(attDesc);

        attType = new AttributeTypeImpl(MULTI_LEAF_ATTRIBUTE, String.class, false, false,
                Collections.EMPTY_LIST, null, null);
        attDesc = new AttributeDescriptorImpl(attType, MULTI_LEAF_ATTRIBUTE, 0, -1, true, null);
        rootProperties.add(attDesc);

        attType = new ComplexTypeImpl(ROOT_ATTRIBUTE, rootProperties, false, false,
                Collections.EMPTY_LIST, null, null);
        attDesc = new AttributeDescriptorImpl(attType, ROOT_ATTRIBUTE, 0, -1, true, null);

        Collection<PropertyDescriptor> nestedProperties = new ArrayList<PropertyDescriptor>(1);
        nestedProperties.add(attDesc);

        // add nested properties to complex attribute
        attType = new ComplexTypeImpl(COMPLEX_ATTRIBUTE, nestedProperties, false, false,
                Collections.EMPTY_LIST, null, null);

        attDesc = new AttributeDescriptorImpl(attType, COMPLEX_ATTRIBUTE, 0, -1, true, null);

        // add to feature schema
        schema.add(attDesc);

        return tfac.createFeatureType(fName, schema, null, false, Collections.EMPTY_LIST, null,
                null);
    }
View Full Code Here

     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    private FeatureTypeMapping createSampleDerivedAttributeMappings() throws Exception {
        // create the target type
        FeatureTypeFactory tf = new UniqueNameFeatureTypeFactoryImpl();
        TypeBuilder builder = new TypeBuilder(tf);

        AttributeType areaOfInfluence = builder.name("areaOfInfluence").bind(Polygon.class)
                .attribute();
        AttributeType concatType = builder.name("concatenated").bind(String.class).attribute();

        builder.setName("target");
        builder.addAttribute("areaOfInfluence", areaOfInfluence);
        builder.addAttribute("concatenated", concatType);

        FeatureType targetType = builder.feature();
        AttributeDescriptor targetFeature = tf.createAttributeDescriptor(targetType, targetType
                .getName(), 0, Integer.MAX_VALUE, true, null);

        // create the mapping definition
        List attMappings = new LinkedList();

View Full Code Here

    public IDFunctionExpressionTest() {
    }

    @Before
    public void setUp() throws Exception {
        FeatureTypeFactory typeFactory = new UniqueNameFeatureTypeFactoryImpl();
        FeatureType type = ComplexTestData.createExample02MultipleMultivalued(typeFactory);
        AttributeBuilder ab = new AttributeBuilder(new ValidatingFeatureFactoryImpl());
        ab.setType(type);
        feature = (Feature) ab.build("test-id");
        idExpr = CommonFactoryFinder.getFilterFactory(null).function("getID", new org.opengis.filter.expression.Expression[0]);
View Full Code Here

   
    @Test
    public void encodeInsert() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FeatureFactory ff = CommonFactoryFinder.getFeatureFactory(null);
        FeatureTypeFactory ftf = new FeatureTypeFactoryImpl();
       
        AttributeDescriptor ad = ftf.createAttributeDescriptor(XSSchema.STRING_TYPE, new NameImpl("dummyAttribute"), 0, 1, true, null);
        SimpleFeatureType ft = ftf.createSimpleFeatureType(new NameImpl("dummyFeatureType"), Collections.singletonList(ad), null, false, null, null, null);
        SimpleFeature feature = ff.createSimpleFeature(new Object[] {"dummyValue"}, ft, "dummyId");
       
        InsertElementType insert = wfsfac.createInsertElementType();
        insert.getFeature().add(feature);       
       
View Full Code Here

   
    @Test
    public void encodeInsert() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FeatureFactory ff = CommonFactoryFinder.getFeatureFactory(null);
        FeatureTypeFactory ftf = new FeatureTypeFactoryImpl();
       
        AttributeDescriptor ad = ftf.createAttributeDescriptor(XSSchema.STRING_TYPE, new NameImpl("dummyAttribute"), 0, 1, true, null);
        SimpleFeatureType ft = ftf.createSimpleFeatureType(new NameImpl("dummyFeatureType"), Collections.singletonList(ad), null, false, null, null, null);
        SimpleFeature feature = ff.createSimpleFeature(new Object[] {"dummyValue"}, ft, "dummyId");
       
        InsertElementType insert = wfsfac.createInsertElementType();
        insert.getFeature().add(feature);       
       
View Full Code Here

            return INSTANCE;
        }

        public FeatureType getFeatureType() {
            FeatureType ft = delegate.getFeatureType();
            FeatureTypeFactory factory = new FeatureTypeFactoryImpl();
            FeatureType gsft = factory.createFeatureType(new NameImpl(GS_NAMESPACE, "Record"), ft.getDescriptors(), null, false, null, ft.getSuper(), null);
            return gsft;
        }
View Full Code Here

TOP

Related Classes of org.opengis.feature.type.FeatureTypeFactory

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.