Package org.geotools.data

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


        ftb.setNamespaceURI(TEST_NAMESPACE);
        ftb.setName(name);
        ftb.add("name", String.class);
        ftb.add("geom", geometryType, wgs84);
        SimpleFeatureType featureType = ftb.buildFeatureType();
        dataStore.createSchema(featureType);

        return new MapLayerInfo(layerInfo);
    }

    public SimpleFeature addFeature(final SimpleFeatureType featureType, final Object[] values)
View Full Code Here


      if (!(crs instanceof CoordinateReferenceSystem)) {
        crs = DefaultGeographicCRS.WGS84;
      }
      SimpleFeatureType featureType = buildFeatureType(sName, iShapeType, fields, sFields, (CoordinateReferenceSystem) crs);
      DataStore mds = createDatastore(filename, featureType);
      mds.createSchema(featureType);
      return createLayer(mds, sName, crs);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

                    return;
                }

                try {
                    SimpleFeatureType featureType = buildFeatureType();
                    ds.createSchema(featureType);

                    CatalogBuilder builder = new CatalogBuilder(getCatalog());
                    builder.setStore(dsInfo);
                    FeatureTypeInfo fti = builder.buildFeatureType(getFeatureSource(ds));
                    LayerInfo layerInfo = builder.buildLayer(fti);
View Full Code Here

            //check to see if this is a virtual JDBC feature type
            MetadataMap mdm = featureType.getMetadata();
            boolean virtual = mdm != null && mdm.containsKey(FeatureTypeInfo.JDBC_VIRTUAL_TABLE);

            if(!virtual && !typeExists) {
                gtds.createSchema(buildFeatureType(featureType));
                // the attributes created might not match up 1-1 with the actual spec due to
                // limitations of the data store, have it re-compute them
                featureType.getAttributes().clear();
                List<String> typeNames = Arrays.asList(gtds.getTypeNames());
                // handle Oracle oddities
View Full Code Here

                        LOGGER.info(featureTypeName + " does not exist in data store " + datastore +
                            ". Attempting to create it");
                       
                        //schema does not exist, create it by first creating an instance of
                        // the source datastore and copying over its schema
                        ds.createSchema(source.getSchema(featureTypeName));
                        featureType = source.getSchema(featureTypeName);
                    }
   
                    FeatureSource featureSource = ds.getFeatureSource(featureTypeName);
                    if (!(featureSource instanceof FeatureStore)) {
View Full Code Here

        //check to see if this is a virtual JDBC feature type
        MetadataMap mdm = featureType.getMetadata();
        boolean virtual = mdm != null && mdm.containsKey(FeatureTypeInfo.JDBC_VIRTUAL_TABLE);
       
        if(!virtual && !typeExists) {
            gtds.createSchema(buildFeatureType(featureType));
            // the attributes created might not match up 1-1 with the actual spec due to
            // limitations of the data store, have it re-compute them
            featureType.getAttributes().clear();
            List<String> typeNames = Arrays.asList(gtds.getTypeNames());
            // handle Oracle oddities
View Full Code Here

       
        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

        ftb.setNamespaceURI(TEST_NAMESPACE);
        ftb.setName(name);
        ftb.add("name", String.class);
        ftb.add("geom", geometryType, wgs84);
        SimpleFeatureType featureType = ftb.buildFeatureType();
        dataStore.createSchema(featureType);

        return new MapLayerInfo(layerInfo);
    }

    public SimpleFeature addFeature(final SimpleFeatureType featureType, final Object[] values)
View Full Code Here

        DataStore dstore = null;
        File file = null;
        try {
            file = new File(tempDir, schema.getTypeName() + ".shp");
            dstore = new ShapefileDataStore(file.toURL());
            dstore.createSchema(schema);
           
            fstore = (SimpleFeatureStore) dstore.getFeatureSource(schema.getTypeName());
            fstore.addFeatures(collection);
        } catch (IOException ioe) {
            LOGGER.log(Level.WARNING,
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.