Package org.geotools.feature.simple

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


     
      if (!existFeatureTable(ds, featureName)) {
        SimpleFeatureTypeBuilder dstSchemaBuilder = new SimpleFeatureTypeBuilder();
        dstSchemaBuilder.setName(featureName);
        dstSchemaBuilder.addAll(attrDescriptorList);
        SimpleFeatureType sft = dstSchemaBuilder.buildFeatureType();
 
        ds.createSchema(sft);
        return true;
      }
    } catch (IOException e) {
View Full Code Here


                CoordinateReferenceSystem crs = ((GeometryDescriptor) descriptor).getCoordinateReferenceSystem();
                builder.setCRS(crs);
            }
            builder.add(descriptor);
        }
        featureType = builder.buildFeatureType();
    }

    @JSConstructor
    public static Object constructor(Context cx, Object[] args, Function ctorObj, boolean inNewExpr) {
        if (args.length != 1) {
View Full Code Here

        tb.setName("shp");
        tb.setCRS(CRS.decode("epsg:4326"));
        tb.add("geometry", Point.class);
        tb.add("index", Integer.class);
       
        SimpleFeatureType proto = tb.buildFeatureType();
       
        int ngroups = 5;
        int n = 100; int m = 1000;
       
        for (int k = 0; k < ngroups; k++) {
View Full Code Here

                System.out.println("Creating shapefile " + file.getAbsolutePath());
               
                ShapefileDataStore ds = new ShapefileDataStore(file.toURL());
                tb.init(proto);
                tb.setName(name);
                ds.createSchema(tb.buildFeatureType());
               
                FeatureWriter fw = ds.getFeatureWriterAppend(name, Transaction.AUTO_COMMIT);
                for (int j = 0; j < m; j++) {
                    fw.hasNext();
                    SimpleFeature f = (SimpleFeature)fw.next();
View Full Code Here

            }
        }
        for (AttributeDescriptor descriptor : added) {
            featureTypeBuilder.add(descriptor);
        }
        SimpleFeatureType featureType = featureTypeBuilder.buildFeatureType();

        return RevFeatureTypeImpl.build(featureType);
    }

}
View Full Code Here

        }

        builder.setAttributes(newAttributes);
        builder.setName(featureType.getName());
        builder.setCRS(featureType.getCoordinateReferenceSystem());
        featureType = builder.buildFeatureType();
        return featureType;

    }

    private SimpleFeatureType forceFeatureTypeName(SimpleFeatureType featureType, String path) {
View Full Code Here

        SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
        builder.setAttributes(featureType.getAttributeDescriptors());
        builder.setName(new NameImpl(featureType.getName().getNamespaceURI(), path));
        builder.setCRS(featureType.getCoordinateReferenceSystem());

        featureType = builder.buildFeatureType();
        return featureType;
    }

    private Iterator<Feature> transformFeatures(SimpleFeatureType featureType, String path) {
        String refspec = Ref.WORK_HEAD + ":" + path;
View Full Code Here

    @Test
    public void testSerializationWGS84() throws Exception {
        SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder();
        ftb.add("geom", Polygon.class, DefaultGeographicCRS.WGS84);
        ftb.setName("type");
        SimpleFeatureType ftype = ftb.buildFeatureType();
        RevFeatureType revFeatureType = RevFeatureTypeImpl.build(ftype);
        ObjectWriter<RevFeatureType> writer = factory.createObjectWriter(TYPE.FEATURETYPE);

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        writer.write(revFeatureType, output);
View Full Code Here

            Preconditions.checkNotNull(geometryType,
                    "The mapping rule does not define a geometry field");
            if (!geometryType.equals(Point.class)) {
                fb.add("nodes", String.class);
            }
            featureType = fb.buildFeatureType();

            featureBuilder = new SimpleFeatureBuilder(featureType);

        }
        return featureType;
View Full Code Here

        for (AttributeDescriptor descriptor : pointsType.getAttributeDescriptors()) {
            builder.add(descriptor);
        }
        builder.setName(pointsType.getName());
        builder.setCRS(pointsType.getCoordinateReferenceSystem());
        SimpleFeatureType outputFeatureType = builder.buildFeatureType();
        MemoryDataStore dataStore = new MemoryDataStore(outputFeatureType);
        final String typeName = dataStore.getTypeNames()[0];
        SimpleFeatureSource featureSource = dataStore.getFeatureSource(typeName);
        SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
        geogig.command(ExportDiffOp.class).setFeatureStore(featureStore).setPath(pointsName)
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.