Examples of buildFeatureType()


Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        attrs.add(builder.buildFeatureType().getDescriptor(2));
        viewer.setSelection(new StructuredSelection(attrs));

        action.runWithEvent(new Event());

        assertEquals(1, builder.buildFeatureType().getAttributeCount());
        assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
        assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$

    }
   
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        viewer.setSelection(new StructuredSelection(attrs));

        action.runWithEvent(new Event());

        assertEquals(1, builder.buildFeatureType().getAttributeCount());
        assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
        assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$

    }
   
    @Ignore
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        action.runWithEvent(new Event());

        assertEquals(1, builder.buildFeatureType().getAttributeCount());
        assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
        assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$

    }
   
    @Ignore
    @Test
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

    SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
    builder.setName("test");
    builder.crs(crs).add("geom", Geometry.class);
    builder.setCRS(crs);
    builder.add("name", String.class);
    SimpleFeatureType ft = builder.buildFeatureType();
    int size = Math.max(geom.length, attributeValue.length);
    SimpleFeature[] features = new SimpleFeature[size];
    for (int i = 0; i < size; i++) {
      Geometry geometry;
      if (i >= geom.length)
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

                SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
                b.setName(name);
                b.setCRS(featureType.getCoordinateReferenceSystem());
                List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors();
                b.addAll(attributeDescriptors);
                featureType = b.buildFeatureType();
                ds.createSchema(featureType);
            }
        } else {
            ds.createSchema(featureType);
        }
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

       
        SimpleFeatureTypeBuilder builder=new SimpleFeatureTypeBuilder();
        builder.setName("test");
        builder.restriction(filter).add(attributeName, String.class);
       
        SimpleFeatureType featureType = builder.buildFeatureType();
       
        AttributeValidator validator=new AttributeValidator(featureType.getDescriptor(attributeName), featureType);
       
        String valid = validator.isValid("Value");
        assertNull( "Valid", valid );
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        assertNotNull( "Should not allow 'IllegalValue'", validator.isValid("IllegalValue") );
       
        assertNotNull( "Should not allow 3", validator.isValid(3) );
       
        builder.length(5).nillable(true).add(attributeName,String.class);
        featureType = builder.buildFeatureType();

        validator=new AttributeValidator(featureType.getDescriptor(attributeName), featureType);
       
        assertNull( validator.isValid("name") );
        assertNotNull( validator.isValid("IllegalValue") );
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

     */
    public void createTable( Composite parent, Object layoutData, SimpleFeatureType type ) {
      SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
      builder.setName(type.getName());
        builder.init(type);
        createTable(parent, layoutData, builder.buildFeatureType(), true);
    }
    /**
     * Create the table control and set the input.
     *
     * @param parent the composite that will be used as the TreeViewer's parent.
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        SimpleFeatureTypeBuilder builder = null;
        if (type != null) {
            builder = new SimpleFeatureTypeBuilder();
            builder.init(type);
            builder.setName(type.getName());
            featureType = builder.buildFeatureType();
        }else{
            featureType = createDefaultFeatureType();
        }
        if (viewer != null) {
            setInput(featureType);
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        builder = new SimpleFeatureTypeBuilder();
        builder.setName(Messages.FeatureTypeEditor_newFeatureTypeName);
        builder.setCRS(getDefaultCRS());
        builder.length(MAX_ATTRIBUTE_LENGTH).add(Messages.FeatureTypeEditor_defaultNameAttributeName, String.class);
        builder.add(Messages.FeatureTypeEditor_defaultGeometryName, LineString.class);
        return builder.buildFeatureType();
    }

    private CoordinateReferenceSystem getDefaultCRS() {
        String crsInfo=UiPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.P_DEFAULT_GEOMEMTRY_CRS);
        if( crsInfo!=null && crsInfo.trim().length()>0 ){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.