Examples of createSchema()


Examples of org.geotools.data.DataStore.createSchema()

            build.setAbstract(false);
            build.add(Messages.NewServiceConnectionFactory_defaultGeom,com.vividsolutions.jts.geom.Geometry.class);
           
            SimpleFeatureType schema = build.buildFeatureType();
           
            ds.createSchema( schema ); //$NON-NLS-1$
        } catch (Exception e) {
            CatalogUIPlugin.log("Error creating MemoryDatastore or feature type", e); //$NON-NLS-1$
            return null;
        }finally{
            monitor.done();
View Full Code Here

Examples of org.geotools.data.DataStore.createSchema()

            } catch (IOException e) {
                return "Error communicating with datastore, check connection and availability of service";
            }
           
            try {
                dataStore.createSchema(mapper.getSchema());
            } catch (IOException e) {
                return "Error creating SimpleFeatureType verify that you have write access";
            }
           
            return null;
View Full Code Here

Examples of org.geotools.data.DataStore.createSchema()

       
        SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
        tb.setName( "widgetsNG" );
        tb.add( "name", String.class );
       
        ds.createSchema( tb.buildFeatureType() );
       
        FeatureWriter fw = ds.getFeatureWriterAppend( "widgetsNG", Transaction.AUTO_COMMIT );
        fw.hasNext();
        SimpleFeature sf = (SimpleFeature) fw.next();
        sf.setAttribute( "name", "one");
View Full Code Here

Examples of org.geotools.data.DataStore.createSchema()

        DataStore dstore = null;
        File file = null;
        try {
            file = new File(tempDir, schema.getTypeName() + ".shp");
            dstore = new ShapefileDataStore(file.toURL());
            dstore.createSchema(schema);
           
            fstore = (FeatureStore<SimpleFeatureType, SimpleFeature>) dstore.getFeatureSource(schema.getTypeName());
            fstore.addFeatures(collection);
        } catch (IOException ioe) {
            LOGGER.log(Level.WARNING,
View Full Code Here

Examples of org.geotools.data.directory.DirectoryDataStore.createSchema()

       
        SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
        tb.setName("foo");
        tb.add("geom", Polygon.class);
        tb.add("bar", Integer.class);
        ds.createSchema(tb.buildFeatureType());
       
        SimpleFeatureType ft = ds.getSchema("foo");
        assertNotNull(ft);
       
        //clean up
View Full Code Here

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

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

                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.data.memory.MemoryDataStore.createSchema()

                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

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

        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

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

        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
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.