Package org.opengis.feature.simple

Examples of org.opengis.feature.simple.SimpleFeatureType


       
        //add the two geometries to a FeatureCollection
        SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
        b.setName( "Test" );
        b.add( "location", Polygon.class );
        SimpleFeatureType type = b.buildFeatureType();
        SimpleFeature donutFeature = SimpleFeatureBuilder.build(type, new Object[]{donut}, "fid.1");
        SimpleFeature holeFeature = SimpleFeatureBuilder.build(type, new Object[]{hole}, "fid.2");
        DefaultFeatureCollection fc = new DefaultFeatureCollection();
        fc.add(donutFeature);
        fc.add(holeFeature);
View Full Code Here


        if( editFeature==null || store==null ){
            noChange=true;
            return;
        }
           
        SimpleFeatureType featureType = editFeature.getFeatureType();
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        subProgressMonitor = new SubProgressMonitor(monitor,1);
        subProgressMonitor.done();
        filter = factory.id(FeatureUtils.stringToId(factory, editFeature.getID()));
        FeatureCollection<SimpleFeatureType, SimpleFeature>  results = store.getFeatures(filter);

        FeatureIterator<SimpleFeature> reader = results.features();
        try {
            if (reader.hasNext()) {
                try {
                    store.modifyFeatures(featureType.getAttributeDescriptors().toArray(
              new AttributeDescriptor[0]), editFeature
              .getAttributes().toArray(), filter);
                } catch (Exception e) {
                    ProjectPlugin.log("", e); //$NON-NLS-1$
                    noChange=true;
View Full Code Here

            return;
        monitor.beginTask(Messages.WriteFeatureChangesCommand_rollbackTask, IProgressMonitor.UNKNOWN);
        if( added ){
            store.removeFeatures(filter);
        }else{
            SimpleFeatureType featureType = this.editFeature.getFeatureType();
            store.modifyFeatures(featureType.getAttributeDescriptors().toArray(new AttributeDescriptor[0]), this.editFeature
                    .getAttributes().toArray(), filter);           
        }
    }
View Full Code Here

public class FeatureTypeAttributeMapperTest {

    @Test
    public void testStraightMappingWithExtraAtts() throws Exception {
        SimpleFeatureType featureType = DataUtilities.createType("IssuesFeatureType", //$NON-NLS-1$
                "bounds:MultiPolygon," + //$NON-NLS-1$
                        "extension:int," + //$NON-NLS-1$
                        "ext:String," + //$NON-NLS-1$
                        "id:Integer," + //$NON-NLS-1$
                        "id2:String," + //$NON-NLS-1$
View Full Code Here

       
    }

    @Test
    public void testDifficultMapping() throws Exception {
        SimpleFeatureType featureType = DataUtilities.createType("IssuesFeatureType", //$NON-NLS-1$
                "b:MultiPolygon," + //$NON-NLS-1$
                        "extension:int," + //$NON-NLS-1$
                        "ee:String," + //$NON-NLS-1$
                        "id:Integer," + //$NON-NLS-1$
                        "i:String," + //$NON-NLS-1$
View Full Code Here

                        List<Rule> rules = rules(styles);
                        for( Rule rule : rules ) {

                            BufferedImage awtIcon = null;
                            if (layer.hasResource(FeatureSource.class) && rule != null) {
                                SimpleFeatureType type = layer.getSchema();
                                GeometryDescriptor geom = type.getGeometryDescriptor();
                                if (geom != null) {
                                    Class geom_type = geom.getType().getBinding();
                                    if (geom_type == Point.class || geom_type == MultiPoint.class) {
                                        awtIcon = point(rule, boxWidth, boxHeight);
                                    } else if (geom_type == LineString.class
View Full Code Here

        if (sld != null) {
            Rule rule = getRule(sld);

            BufferedImage swtIcon = null;
            if (layer.hasResource(FeatureSource.class) && rule != null) {
                SimpleFeatureType type = layer.getSchema();
                GeometryDescriptor geom = type.getGeometryDescriptor();
                if (geom != null) {
                    Class geom_type = geom.getType().getBinding();
                    if (geom_type == Point.class || geom_type == MultiPoint.class) {
                        swtIcon = point(rule, boxWidth, boxHeight);
                    } else if (geom_type == LineString.class || geom_type == MultiLineString.class) {
View Full Code Here

        return delegate.hashCode();
    }

    @Override
    public void setAttribute( int index, Object value ) {
        SimpleFeatureType schema = getFeatureType();
        AttributeDescriptor attribute = schema.getAttributeDescriptors().get(index);
        String name = attribute.getLocalName();
        SetAttributeCommand sync = new SetAttributeCommand(name, value);
        dirty.add(name);
        manager.getMap().sendCommandASync(sync);
    }
View Full Code Here

    @Override
    public void setAttributes( List<Object> values ) {
        String[] xpath;
        Object[] value;
        ArrayList<String> xpathlist = new ArrayList<String>();
        SimpleFeatureType schema = getFeatureType();
        for( PropertyDescriptor x : schema.getDescriptors() ) {
            xpathlist.add(x.getName().getLocalPart());
            dirty.add(x.getName().getLocalPart());
        }
        xpath = xpathlist.toArray(new String[xpathlist.size()]);
        value = values.toArray();
View Full Code Here

    }
    @Override
    public void setAttributes( Object[] values ) {
        String[] xpath;
        ArrayList<String> xpathlist = new ArrayList<String>();
        SimpleFeatureType schema = getFeatureType();
        for( PropertyDescriptor x : schema.getDescriptors() ) {
            xpathlist.add(x.getName().getLocalPart());
        }
        dirty.addAll(xpathlist);
        xpath = xpathlist.toArray( new String[xpathlist.size()]);
        SetAttributesCommand sync = new SetAttributesCommand(xpath, values);
View Full Code Here

TOP

Related Classes of org.opengis.feature.simple.SimpleFeatureType

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.