Package org.geotools.data.memory

Examples of org.geotools.data.memory.MemoryDataStore.createSchema()


                        try {
                            store.getSchema(spec[0]);
                        } catch (Exception e) {
                            // schema does not exist create it
                            try {
                                store.createSchema(DataUtilities.createType(spec[0], spec[1]));
                            } catch (Exception e2) {
                                CatalogPlugin.log("Error creating type in datastore", e2); //$NON-NLS-1$
                            }
                        }
                    }
View Full Code Here


                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

                b.addAll(attributeDescriptors);
                featureType = b.buildFeatureType();
                ds.createSchema(featureType);
            }
        } else {
            ds.createSchema(featureType);
        }

        IGeoResource resource = null;
        for( IResolve resolve : service.resources(new NullProgressMonitor()) ) {
            if (resolve instanceof IGeoResource) {
View Full Code Here

        SimpleFeature f1 = SimpleFeatureBuilder.build(type, new Object[] { point }, null);
        SimpleFeature f2 = SimpleFeatureBuilder.build(type, new Object[] { line }, null);
        SimpleFeature f3 = SimpleFeatureBuilder.build(type, new Object[] { polygon }, null);

        MemoryDataStore ds = new MemoryDataStore();
        ds.createSchema(type);
        ds.addFeatures(new SimpleFeature[] { f1, f2, f3 });

        FeatureSource fs = ds.getFeatureSource("test");

        final WMSMapContext map = new WMSMapContext();
View Full Code Here

        tb.add("level", Integer.class);

        SimpleFeatureType type = tb.buildFeatureType();
        MemoryDataStore ds = new MemoryDataStore();

        ds.createSchema(type);

        FeatureWriter<SimpleFeatureType, SimpleFeature> writer;
        writer = ds.getFeatureWriterAppend("latlon", Transaction.AUTO_COMMIT);

        for (int lon = -180; lon < 180; lon += 5) {
View Full Code Here

        testDataStore.addFeature(f4);
        testDataStore.addFeature(f5);
        testDataStore.addFeature(f6);
        testDataStore.addFeature(f7);
        testDataStore.addFeature(f8);
        testDataStore.createSchema(builder4.buildFeatureType());

        final AbstractDataStoreFactory factory = mock(AbstractDataStoreFactory.class);
        when(factory.createDataStore(anyMapOf(String.class, Serializable.class))).thenReturn(
                testDataStore);
        when(factory.canProcess(anyMapOf(String.class, Serializable.class))).thenReturn(true);
View Full Code Here

        tb.add("temp", Integer.class);
        tb.add("turbidity", Float.class);

        SimpleFeatureType type = tb.buildFeatureType();

        dataStore.createSchema(type);

        final int NUM_FEATURES = 10;

        SimpleFeatureBuilder fbuilder = new SimpleFeatureBuilder(type);
        for (int i = 0; i < NUM_FEATURES; i++) {
View Full Code Here

        SimpleFeatureTypeImpl sft = new SimpleFeatureTypeImpl(new NameImpl(fname), attrs, typ
                .getGeometryDescriptor(), typ.isAbstract(), typ.getRestrictions(), typ.getSuper(),
                typ.getDescription());

        memDS.createSchema(sft);
        REPOSITORY.register(name, memDS);
        return memDS;
    }

    private static MemoryDataStore createMemStoreMixed(SimpleFeatureType typ, String name,
View Full Code Here

        attrs.add(geom2Descr);
        SimpleFeatureTypeImpl sft = new SimpleFeatureTypeImpl(new NameImpl(fname), attrs, typ
                .getGeometryDescriptor(), typ.isAbstract(), typ.getRestrictions(), typ.getSuper(),
                typ.getDescription());

        memDS.createSchema(sft);
        REPOSITORY.register(name, memDS);
        return memDS;
    }

    private static MemoryDataStore createMemStoreHorizontal(SimpleFeatureType typ, String name,
View Full Code Here

        SimpleFeatureTypeImpl sft = new SimpleFeatureTypeImpl(new NameImpl(fname), attrs, typ
                .getGeometryDescriptor(), typ.isAbstract(), typ.getRestrictions(), typ.getSuper(),
                typ.getDescription());

        memDS.createSchema(sft);
        REPOSITORY.register(name, memDS);
        return memDS;
    }

    private static void addGeneralizedFeatureVertical(SimpleFeature feature, MemoryDataStore memDS,
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.